Module: check_mk
Branch: master
Commit: 0ef04f794c0c08353055b95948fdad7b4a3edff3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ef04f794c0c08…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 24 11:51:34 2018 +0200
Make pylint report correct paths for real modules and compiled check/inventory/bakery
plugin files
Change-Id: I3424621f78fb4e0a26353676d508cc640c60572b
---
tests/testlib/pylint_cmk.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/testlib/pylint_cmk.py b/tests/testlib/pylint_cmk.py
index d3704fc..32acb8d 100644
--- a/tests/testlib/pylint_cmk.py
+++ b/tests/testlib/pylint_cmk.py
@@ -112,8 +112,15 @@ def is_python_file(path):
# python modules. This custom reporter rewrites the found
# messages to tell the users the original location in the
# python sources
+# TODO: This can be dropped once we have refactored checks/inventory/bakery plugins
+# to real modules
class CMKFixFileMixin(object):
def handle_message(self, msg):
+ # This hack is not needed for already modularized paths
+ if msg.abspath.startswith(cmk_path()):
+ super(CMKFixFileMixin, self).handle_message(msg)
+ return
+
new_path, new_line = self._orig_location_from_compiled_file(msg)
if new_path == None: