Module: check_mk
Branch: master
Commit: b6b1c1ff7489b7ab5902a625036e92f34ba8b331
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6b1c1ff7489b7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sat Apr 23 22:05:13 2016 +0200
pylint: Using file/line fix for build system too
---
pylint/Makefile | 2 +-
pylint/pylint_cmk.py | 18 +++++++++++++++---
pylint/pylintrc.checks | 2 +-
pylint/pylintrc.modules | 2 +-
pylint/pylintrc.web | 2 +-
5 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/pylint/Makefile b/pylint/Makefile
index 5511a4f..fd709eb 100644
--- a/pylint/Makefile
+++ b/pylint/Makefile
@@ -19,7 +19,7 @@ checks:
build:
export TERM="linux" ; \
- export PYLINT_ARGS="--output-format=parseable" ; \
+ export PYLINT_ARGS="--output-format=cmk_parseable" ; \
export PYLINT_OUTPUT="$$WORKDIR/pylint.log" ; \
echo -n > pylint.log ; \
$(MAKE) all
diff --git a/pylint/pylint_cmk.py b/pylint/pylint_cmk.py
index a2198e0..06cbde2 100644
--- a/pylint/pylint_cmk.py
+++ b/pylint/pylint_cmk.py
@@ -8,7 +8,7 @@ import shutil
import subprocess
import tempfile
-from pylint.reporters.text import ColorizedTextReporter
+from pylint.reporters.text import ColorizedTextReporter, ParseableTextReporter
from pylint.utils import Message
@@ -142,7 +142,7 @@ def ensure_equal_branches():
# python modules. This custom reporter rewrites the found
# messages to tell the users the original location in the
# python sources
-class CMKColorizedTextReporter(ColorizedTextReporter):
+class CMKFixFileMixin(object):
def handle_message(self, msg):
lines = file(msg.abspath).readlines()
@@ -159,7 +159,18 @@ class CMKColorizedTextReporter(ColorizedTextReporter):
if orig_file != None:
msg = msg._replace(line=went_back, path=orig_file)
- ColorizedTextReporter.handle_message(self, msg)
+ super(CMKFixFileMixin, self).handle_message(msg)
+
+
+
+class CMKColorizedTextReporter(CMKFixFileMixin, ColorizedTextReporter):
+ name = "cmk_colorized"
+
+
+
+class CMKParseableTextReporter(CMKFixFileMixin, ParseableTextReporter):
+ name = "cmk_parseable"
+
# Is called by pylint to load this plugin
@@ -169,3 +180,4 @@ def register(linter):
+ sys.path
linter.register_reporter(CMKColorizedTextReporter)
+ linter.register_reporter(CMKParseableTextReporter)
diff --git a/pylint/pylintrc.checks b/pylint/pylintrc.checks
index 27defb2..a667903 100644
--- a/pylint/pylintrc.checks
+++ b/pylint/pylintrc.checks
@@ -27,7 +27,7 @@
disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequenc
ignored-modules = rrdtool
[REPORTS]
-output-format=colorized
+output-format=cmk_colorized
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
[FORMAT]
diff --git a/pylint/pylintrc.modules b/pylint/pylintrc.modules
index 7194bb7..1c307ae 100644
--- a/pylint/pylintrc.modules
+++ b/pylint/pylintrc.modules
@@ -27,7 +27,7 @@
disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequenc
ignored-modules = rrdtool
[REPORTS]
-output-format=colorized
+output-format=cmk_colorized
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
[FORMAT]
diff --git a/pylint/pylintrc.web b/pylint/pylintrc.web
index bc42d0c..1ff6551 100644
--- a/pylint/pylintrc.web
+++ b/pylint/pylintrc.web
@@ -21,7 +21,7 @@
disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequenc
ignored-modules = ldap
[REPORTS]
-output-format=colorized
+output-format=cmk_colorized
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
[FORMAT]