summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorLCD 47 <lcd047@gmail.com>2014-10-10 11:37:53 +0300
committerLCD 47 <lcd047@gmail.com>2014-10-10 11:37:53 +0300
commitf6607f7f69ac23a46961f90f5459b41a6068b5c0 (patch)
treec4abd0f50aa21f1a6ed43674eb18c5f14464872a /utils.py
parent9e502c9ff00717d47b30739f892d37ba1c424306 (diff)
downloadpylint-git-f6607f7f69ac23a46961f90f5459b41a6068b5c0.tar.gz
Fix expansion of {path} in --msg-template.
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/utils.py b/utils.py
index 068afce6f..fd1470999 100644
--- a/utils.py
+++ b/utils.py
@@ -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):
@@ -391,14 +391,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"""