diff options
author | Anthony Truchet <anthony.truchet@logilab.fr> | 2013-07-30 18:02:48 +0200 |
---|---|---|
committer | Anthony Truchet <anthony.truchet@logilab.fr> | 2013-07-30 18:02:48 +0200 |
commit | 188e7dde3aa7b7422d2328d789572c0b62dee711 (patch) | |
tree | d30eeae5f3a171f06d0be4ab5a32f7c88c2d2370 /reporters/html.py | |
parent | 1cf2d3fef9e18f45fafdac3119af0ad5355575d8 (diff) | |
download | pylint-git-188e7dde3aa7b7422d2328d789572c0b62dee711.tar.gz |
Templating mecanism for text reporters.
This changeset introduces a reporters.Message class to represent
messages with their attached data. Those messages object can then
be formatted accordingto some template.
A template can be specified on the command line through the
msg-template option.
This deprecates parseable and msvc output format, and kill --symbols
and --include-ids option.
Diffstat (limited to 'reporters/html.py')
-rw-r--r-- | reporters/html.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/reporters/html.py b/reporters/html.py index 23c1d18d4..a51e0e7bb 100644 --- a/reporters/html.py +++ b/reporters/html.py @@ -1,5 +1,4 @@ -# Copyright (c) 2003-2006 Sylvain Thenault (thenault@gmail.com). -# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE). +# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later @@ -20,7 +19,7 @@ from cgi import escape from logilab.common.ureports import HTMLWriter, Section, Table from pylint.interfaces import IReporter -from pylint.reporters import BaseReporter +from pylint.reporters import BaseReporter, Message class HTMLReporter(BaseReporter): @@ -36,9 +35,9 @@ class HTMLReporter(BaseReporter): def add_message(self, msg_id, location, msg): """manage message of different type and in the context of path""" - module, obj, line, col_offset = location[1:] - sigle = self.make_sigle(msg_id) - self.msgs += [sigle, module, obj, str(line), str(col_offset), escape(msg)] + msg = Message(self, msg_id, location, msg) + self.msgs += (msg.category, msg.module, msg.obj, + str(msg.line), str(msg.column), escape(msg.msg)) def set_output(self, output=None): """set output stream |