Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
125 lines (121 sloc) 6.22 KB
[MASTER]
# Setup the Python paths needed for our tests. This is a bit tricky due to the
# fact that we want to be able to run pylint with and without the --rcfile
# option. Pylint offers pylint.config.PYLINTRC to get the path to the
# automatically found config file, but this doesn't take --rcfile into account.
# So we have to fall back to a slightly hacky method discussed in the post
# https://mail.python.org/pipermail/code-quality/2016-June/000781.html,
# accessing pylint's innards. Not nice, but there is not much we can do about
# this until pylint offers the API requested in the post above. Furthermore,
# note that layout/indentation doesn't work too well in the hook below.
init-hook=
import inspect, os, sys
config_file = inspect.stack()[2][0].f_locals["linter"].config_file
tests_dir = os.path.join(os.path.dirname(config_file), "tests")
sys.path.insert(0, os.environ.get("TEST_PATH", tests_dir))
import conftest
load-plugins=testlib.pylint_cmk,testlib.pylint_checker_localization
jobs=0
# TODO: Why do we need persistence?
persistent=yes
extension-pkg-whitelist=rrdtool,_ldap,netifaces,pymssql
[MESSAGES CONTROL]
disable=
#---------------------------------------------------------------------------
# We should really enable this, there could be some real exceptions waiting
# to be thrown. But some work is needed first to sprinkle abc annotations
# through our code and fix a few obscure places.
abstract-method,
#---------------------------------------------------------------------------
# Enabling this would be very desirable, it vastly improves readability and
# it might even be necessary for tools like mypy. Fixing this involves some
# amount of relatively easy work, especially if we want to avoid code
# duplication (introduce new classes, combine methods, etc.)
attribute-defined-outside-init,
#---------------------------------------------------------------------------
# Enabling these warnings would be nice, they are mostly a sign of sloppy
# programming practice. In some cases, they can even hide bugs.
bare-except,
broad-except,
#---------------------------------------------------------------------------
# Enabling this would enhance readability quite a bit and it might even
# uncover bugs. Fixing this is not rocket science, just some work.
inconsistent-return-statements,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. Nevertheless, this would
# improve readability and involve some cleanups in our class hierarchy, so
# we should do this some day.
protected-access,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. At the moment, we have quite
# a few violations, so we postpone fixing this.
no-self-use,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. At the moment, we have quite
# a few violations (about 220 in roughly 40 modules), so we postpone fixing
# this. Note that due to our arcane use of types, we need to be very careful
# when fixing these warnings!
len-as-condition,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. At the moment, we have quite
# a few violations, so we postpone fixing this. When we do it eventually, we
# probably want to use "include-naming-hint=yes" in the BASIC section.
invalid-name,
#---------------------------------------------------------------------------
# Enable these would improve readability, but currently there are quite a
# few places to fix.
wrong-import-position,
#---------------------------------------------------------------------------
# Enabling this would be nice, but not crucial. At the moment, we have quite
# a few violations, so we postpone fixing this.
unused-argument,
#---------------------------------------------------------------------------
# Alas, these maintenance/security nightmares are still part of our base
# "technology"... :-/ Nevertheless, reducing their usage is a very worthy
# goal.
eval-used,
exec-used,
global-statement,
#---------------------------------------------------------------------------
# Enabling these would be nice, but given the current state of affairs
# (gigantic modules with deeply nested humungous functions/methods), this
# will be a non-trivial amount of work.
too-few-public-methods,
too-many-arguments,
too-many-boolean-expressions,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
#---------------------------------------------------------------------------
# Enabling these would be nice, but at the moment pylint is a bit too dumb,
# so it stumbles over e.g. initialization with None. It ignores control
# flow, so even adding e.g. isinstance() guards wouldn't help, see:
# https://github.com/PyCQA/pylint/issues/1498.
unsubscriptable-object,
unsupported-membership-test,
#---------------------------------------------------------------------------
# Our code is still full of FIXMEs/XXXs/TODOs, perhaps fixing or removing
# them might be a good idea some day...
fixme,
#---------------------------------------------------------------------------
# The warnigns below will probably fixed by YAPF.
bad-continuation,
bad-whitespace,
line-too-long,
#---------------------------------------------------------------------------
# We are light years away from enabling this...
missing-docstring,
#---------------------------------------------------------------------------
# Enabling the two spelling-related checks increases pylints runtime from
# 11 min to 40 min, so we better keep those disabled for normal runs.
wrong-spelling-in-comment,
wrong-spelling-in-docstring,
[REPORTS]
output-format=cmk_colorized
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
[FORMAT]
max-line-length=100
You can’t perform that action at this time.