summaryrefslogtreecommitdiff
path: root/reporters
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-10-15 14:30:13 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2014-10-15 14:30:13 +0300
commitc03fefdefba97e187f5458288227f4224ee53cc0 (patch)
tree29ebd239f004e793f01a15e07e3f4b129ca6e474 /reporters
parent4ea910d67ccc0c96593a89a539791f97c5043284 (diff)
downloadpylint-git-c03fefdefba97e187f5458288227f4224ee53cc0.tar.gz
Add new '-j' option for running checks in sub-processes.
Patch by Michal Nowikowski.
Diffstat (limited to 'reporters')
-rw-r--r--reporters/__init__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/reporters/__init__.py b/reporters/__init__.py
index 8be5d3ab6..5ebb6aaf7 100644
--- a/reporters/__init__.py
+++ b/reporters/__init__.py
@@ -62,7 +62,7 @@ class BaseReporter(object):
Invokes the legacy add_message API by default."""
self.add_message(
- msg.msg_id, (msg.abspath, msg.module, msg.obj, msg.line, msg.column),
+ msg.msg_id, (msg.abspath, msg.module, msg.obj, msg.line, msg.column),
msg.msg)
def add_message(self, msg_id, location, msg):
@@ -115,6 +115,19 @@ class BaseReporter(object):
pass
+class CollectingReporter(BaseReporter):
+ """collects messages"""
+
+ name = 'collector'
+
+ def __init__(self):
+ BaseReporter.__init__(self)
+ self.messages = []
+
+ def handle_message(self, msg):
+ self.messages.append(msg)
+
+
def initialize(linter):
"""initialize linter with reporters in this package """
utils.register_plugins(linter, __path__[0])