diff options
| author | Claudiu Popa <pcmanticore@gmail.com> | 2014-10-16 14:22:06 +0300 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-10-16 14:22:06 +0300 |
| commit | 00e7dc3b23ed9fb98d71fc2e39abe9fb471a3d10 (patch) | |
| tree | 76ee0bc6dc9ce7b3fb6fbfdd3d6bc3b5b7242aae /utils.py | |
| parent | c03fefdefba97e187f5458288227f4224ee53cc0 (diff) | |
| parent | 1625e73cac5728a555c1b7004decaa83129d2787 (diff) | |
| download | pylint-git-00e7dc3b23ed9fb98d71fc2e39abe9fb471a3d10.tar.gz | |
Fix a regression, where '{path}' was no longer accepted in '--msg-template'.
Patch by LCD47.
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -84,7 +84,7 @@ class WarningScope(object): _MsgBase = collections.namedtuple( '_MsgBase', ['msg_id', 'symbol', 'msg', 'C', 'category', 'confidence', - 'abspath', 'module', 'obj', 'line', 'column']) + 'abspath', 'path', 'module', 'obj', 'line', 'column']) class Message(_MsgBase): @@ -95,7 +95,13 @@ class Message(_MsgBase): confidence, *location) def get_init_args(self): - location = (self.abspath, self.module, self.obj, self.line, self.column) + location = ( + self.abspath, + self.path, + self.module, + self.obj, + self.line, + self.column) return (self.msg_id, self.symbol, location, self.msg, self.confidence) def format(self, template): @@ -395,14 +401,15 @@ class MessagesHandlerMixIn(object): # get module and object if node is None: module, obj = self.current_name, '' - path = self.current_file + abspath = self.current_file else: module, obj = get_module_and_frameid(node) - path = node.root().file + abspath = node.root().file + path = abspath.replace(self.reporter.path_strip_prefix, '') # add the message self.reporter.handle_message( Message(msgid, symbol, - (path, module, obj, line or 1, col_offset or 0), msg, confidence)) + (abspath, path, module, obj, line or 1, col_offset or 0), msg, confidence)) def print_full_documentation(self): """output a full documentation in ReST format""" |
