Module: check_mk
Branch: master
Commit: e68782cba289e64ab7986aa4599ef2ba01e9d350
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e68782cba289e6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 25 08:05:20 2016 +0200
pylint: Merged pylintrc files to a single one
---
pylint/pylint-checks | 2 +-
pylint/pylint-modules | 2 +-
pylint/pylint-web | 2 +-
pylint/pylint_cmk.py | 4 +--
pylint/{pylintrc.modules => pylintrc} | 14 +++++++---
pylint/pylintrc.checks | 48 ---------------------------------
pylint/pylintrc.web | 40 ---------------------------
7 files changed, 15 insertions(+), 97 deletions(-)
diff --git a/pylint/pylint-checks b/pylint/pylint-checks
index a331f88..16044ed 100755
--- a/pylint/pylint-checks
+++ b/pylint/pylint-checks
@@ -20,4 +20,4 @@ for path in pylint_cmk.check_files():
f.close()
-sys.exit(pylint_cmk.run_pylint("pylintrc.checks", base_path))
+sys.exit(pylint_cmk.run_pylint(base_path))
diff --git a/pylint/pylint-modules b/pylint/pylint-modules
index b70e331..da40389 100755
--- a/pylint/pylint-modules
+++ b/pylint/pylint-modules
@@ -14,4 +14,4 @@ for path in pylint_cmk.ordered_module_files():
pylint_cmk.add_file(f, path)
f.close()
-sys.exit(pylint_cmk.run_pylint("pylintrc.modules", base_path))
+sys.exit(pylint_cmk.run_pylint(base_path))
diff --git a/pylint/pylint-web b/pylint/pylint-web
index 92e53cd..e910547 100755
--- a/pylint/pylint-web
+++ b/pylint/pylint-web
@@ -66,4 +66,4 @@ for plugin_dir in get_web_plugin_dirs():
pylint_cmk.add_file(module, plugin_path)
module.close()
-sys.exit(pylint_cmk.run_pylint("pylintrc.web", base_path))
+sys.exit(pylint_cmk.run_pylint(base_path))
diff --git a/pylint/pylint_cmk.py b/pylint/pylint_cmk.py
index 06cbde2..fb5efc9 100644
--- a/pylint/pylint_cmk.py
+++ b/pylint/pylint_cmk.py
@@ -93,13 +93,13 @@ def get_test_dir():
return base_path
-def run_pylint(cfg_file, base_path):
+def run_pylint(base_path):
pylint_args = os.environ.get("PYLINT_ARGS", "")
if pylint_args:
pylint_args += " "
pylint_output = os.environ.get("PYLINT_OUTPUT")
- pylint_cfg = os.getcwd() + "/" + cfg_file
+ pylint_cfg = os.getcwd() + "/pylintrc"
os.putenv("PYLINT_PATH", os.getcwd())
cmd = "pylint --rcfile=\"%s\" %s*.py" % (pylint_cfg,
pylint_args)
diff --git a/pylint/pylintrc.modules b/pylint/pylintrc
similarity index 69%
rename from pylint/pylintrc.modules
rename to pylint/pylintrc
index 1c307ae..ba825cf 100644
--- a/pylint/pylintrc.modules
+++ b/pylint/pylintrc
@@ -21,10 +21,14 @@ disable=C0111,C0326
disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
[TYPECHECK]
-# Can not check methods / attributes of the rrdtool C module. Skipping related errors
-# like the following:
-# [E1101(no-member), create_rrd] Module 'rrdtool' has no 'create' member
-ignored-modules = rrdtool
+# rrdtool
+# Can not check methods / attributes of the rrdtool C module. Skipping related errors
+# like the following:
+# [E1101(no-member), create_rrd] Module 'rrdtool' has no 'create'
member
+# ldap
+# The Python ldap module gets a lot of constants from the C API which can not be found
by pylint.
+# This results in a lot of these errors: "Module 'ldap' has no
'OPT_REFERRALS' member".
+ignored-modules = rrdtool,ldap
[REPORTS]
output-format=cmk_colorized
@@ -38,6 +42,8 @@ indent-string=' '
[VARIABLES]
# Ignore these unused variables (e.g. _no_item,_no_params)
dummy-variables-rgx=^_.*
+# Needed by web code because of super globals. TODO Clean this up some day
+additional-builtins=html,_,_u,current_language,HTML
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
diff --git a/pylint/pylintrc.checks b/pylint/pylintrc.checks
deleted file mode 100644
index a667903..0000000
--- a/pylint/pylintrc.checks
+++ /dev/null
@@ -1,48 +0,0 @@
-[MASTER]
-# Use the OMD default version lib dir to add the mod_python modules
-init-hook='import sys; sys.path.insert(0,
os.environ.get("PYLINT_PATH"))'
-load-plugins=pylint_cmk
-persistent=yes
-# We only want to see errors for the moment. Disable this one day. But prepare to cleanup
a lot of stuff.
-errors-only=yes
-
-[MESSAGES CONTROL]
-# C0111 missing module docstring
-# C0326 bad-whitespace
-disable=C0111,C0326
-# unsubscriptable-object
-# unsupported-membership-test
-# unpacking-non-sequence
-# Disable this because we often use multiple types for a single variable. Maybe we
-# can change this in future to make such linter checks work, but for the moment these
-# checks are useless with Check_MK.
-# unpacking-non-sequence
-# Not a problem for us
-disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
-
-[TYPECHECK]
-# Can not check methods / attributes of the rrdtool C module. Skipping related errors
-# like the following:
-# [E1101(no-member), create_rrd] Module 'rrdtool' has no 'create' member
-ignored-modules = rrdtool
-
-[REPORTS]
-output-format=cmk_colorized
-msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
-
-[FORMAT]
-max-line-length=100
-single-line-if-stmt=no
-indent-string=' '
-
-[VARIABLES]
-# Ignore these unused variables (e.g. _no_item,_no_params)
-dummy-variables-rgx=^_.*
-
-# FIXME lm: How to make this different for checks / web / ...?
-# patch /usr/lib/python2.7/dist-packages/pylint/checkers/variables.py to make regexes
possible here.
-#additional-builtins=factory_settings,saveint,savefloat,snmp_info,snmp_scan_functions,check_info,special_agent_info,time,sys,check_temperature,check_humidity,get_age_human_readable,get_timestamp_human_readable,get_rate,get_relative_date_human_readable,get_bytes_human_readable,get_average,g_hostname,OID_END,OID_STRING,CACHED_OID,re,get_percent_human_readable,MKGeneralException,MKCounterWrapped,GRAB_USER,g_item_state,get_item_state,set_item_state,clear_item_state,quote_shell_string,regex,SKIP,RAISE,ZERO,get_nic_speed_human_readable,fnmatch,host_extra_conf,host_extra_conf_merged,hosttags_match_taglist,tags_of_host,in_extraconf_hostlist,core_state_names,active_check_info,is_ipv6_primary,~(check|parse|inventory|snmp_scan|scan)_.*,~.*_scan_function
-
-[MISCELLANEOUS]
-# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,TODO
diff --git a/pylint/pylintrc.web b/pylint/pylintrc.web
deleted file mode 100644
index 1ff6551..0000000
--- a/pylint/pylintrc.web
+++ /dev/null
@@ -1,40 +0,0 @@
-[MASTER]
-# Use the OMD default version lib dir to add the mod_python modules
-init-hook='import sys; sys.path.insert(0,
os.environ.get("PYLINT_PATH"))'
-load-plugins=pylint_cmk
-persistent=yes
-# We only want to see errors for the moment. Disable this one day. But prepare to cleanup
a lot of stuff.
-errors-only=yes
-
-[MESSAGES CONTROL]
-# C0111 missing module docstring
-# C0326 bad-whitespace
-disable=C0111,C0326
-# Disable this because we often use multiple types for a single variable. Maybe we
-# can change this in future to make such linter checks work, but for the moment these
-# checks are useless with Check_MK.
-disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence
-
-[TYPECHECK]
-# The Python ldap module gets a lot of constants from the C API which can not be found by
pylint.
-# This results in a lot of these errors: "Module 'ldap' has no
'OPT_REFERRALS' member".
-ignored-modules = ldap
-
-[REPORTS]
-output-format=cmk_colorized
-msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
-
-[FORMAT]
-max-line-length=100
-single-line-if-stmt=no
-indent-string=' '
-
-[VARIABLES]
-# Ignore these unused variables (e.g. _no_item,_no_params)
-dummy-variables-rgx=^_.*
-
-additional-builtins=html,_,_u,current_language,HTML
-
-[MISCELLANEOUS]
-# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,TODO