Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / .pylintrc
blob35467593110e9768743cdf25ccb5fce45bb5f049
1 [MASTER]
2 # Setup the Python paths needed for our tests. This is a bit tricky due to the
3 # fact that we want to be able to run pylint with and without the --rcfile
4 # option. Pylint offers pylint.config.PYLINTRC to get the path to the
5 # automatically found config file, but this doesn't take --rcfile into account.
6 # So we have to fall back to a slightly hacky method discussed in the post
7 # https://mail.python.org/pipermail/code-quality/2016-June/000781.html,
8 # accessing pylint's innards. Not nice, but there is not much we can do about
9 # this until pylint offers the API requested in the post above. Furthermore,
10 # note that layout/indentation doesn't work too well in the hook below.
11 init-hook=
12     import inspect, os, sys
13     config_file = inspect.stack()[2][0].f_locals["linter"].config_file
14     tests_dir = os.path.join(os.path.dirname(config_file), "tests")
15     sys.path.insert(0, os.environ.get("TEST_PATH", tests_dir))
16     import conftest
17 load-plugins=testlib.pylint_cmk,testlib.pylint_checker_localization
18 jobs=0
19 # TODO: Why do we need persistence?
20 persistent=yes
21 extension-pkg-whitelist=rrdtool,_ldap,netifaces,pymssql
23 [MESSAGES CONTROL]
24 disable=
25     #---------------------------------------------------------------------------
26     # We should really enable this, there could be some real exceptions waiting
27     # to be thrown. But some work is needed first to sprinkle abc annotations
28     # through our code and fix a few obscure places.
29     abstract-method,
30     #---------------------------------------------------------------------------
31     # Enabling this would be very desirable, it vastly improves readability and
32     # it might even be necessary for tools like mypy. Fixing this involves some
33     # amount of relatively easy work, especially if we want to avoid code
34     # duplication (introduce new classes, combine methods, etc.)
35     attribute-defined-outside-init,
36     #---------------------------------------------------------------------------
37     # Enabling these warnings would be nice, they are mostly a sign of sloppy
38     # programming practice. In some cases, they can even hide bugs.
39     bare-except,
40     broad-except,
41     #---------------------------------------------------------------------------
42     # Enabling this would enhance readability quite a bit and it might even
43     # uncover bugs. Fixing this is not rocket science, just some work.
44     inconsistent-return-statements,
45     #---------------------------------------------------------------------------
46     # Enabling this would enhance readability quite a bit and it might even
47     # uncover bugs. Fixing this is not rocket science, just some work: Roughly
48     # 400 warnings in about 60 modules, but this can be fixed step by step.
49     redefined-outer-name,
50     #---------------------------------------------------------------------------
51     # Enabling this would be nice, but not crucial. Nevertheless, this would
52     # improve readability and involve some cleanups in our class hierarchy, so
53     # we should do this some day.
54     protected-access,
55     #---------------------------------------------------------------------------
56     # Enabling this would be nice, but not crucial. At the moment, we have quite
57     # a few violations, so we postpone fixing this.
58     no-self-use,
59     #---------------------------------------------------------------------------
60     # Enabling this would be nice, but not crucial. At the moment, we have quite
61     # a few violations (about 220 in roughly 40 modules), so we postpone fixing
62     # this. Note that due to our arcane use of types, we need to be very careful
63     # when fixing these warnings!
64     len-as-condition,
65     #---------------------------------------------------------------------------
66     # Enabling this would be nice, but not crucial. At the moment, we have quite
67     # a few violations, so we postpone fixing this. When we do it eventually, we
68     # probably want to use "include-naming-hint=yes" in the BASIC section.
69     invalid-name,
70     #---------------------------------------------------------------------------
71     # Enable these would improve readability, but currently there are quite a
72     # few places to fix.
73     wrong-import-position,
74     #---------------------------------------------------------------------------
75     # Enabling this would be nice, but not crucial. At the moment, we have quite
76     # a few violations, so we postpone fixing this.
77     unused-argument,
78     #---------------------------------------------------------------------------
79     # Alas, these maintenance/security nightmares are still part of our base
80     # "technology"... :-/ Nevertheless, reducing their usage is a very worthy
81     # goal.
82     eval-used,
83     exec-used,
84     global-statement,
85     #---------------------------------------------------------------------------
86     # Enabling these would be nice, but given the current state of affairs
87     # (gigantic modules with deeply nested humungous functions/methods), this
88     # will be a non-trivial amount of work.
89     too-few-public-methods,
90     too-many-arguments,
91     too-many-boolean-expressions,
92     too-many-instance-attributes,
93     too-many-lines,
94     too-many-locals,
95     too-many-nested-blocks,
96     too-many-public-methods,
97     too-many-return-statements,
98     too-many-statements,
99     #---------------------------------------------------------------------------
100     # Enabling these would be nice, but at the moment pylint is a bit too dumb,
101     # so it stumbles over e.g. initialization with None. It ignores control
102     # flow, so even adding e.g. isinstance() guards wouldn't help, see:
103     # https://github.com/PyCQA/pylint/issues/1498.
104     unsubscriptable-object,
105     unsupported-membership-test,
106     #---------------------------------------------------------------------------
107     # Our code is still full of FIXMEs/XXXs/TODOs, perhaps fixing or removing
108     # them might be a good idea some day...
109     fixme,
110     #---------------------------------------------------------------------------
111     # The warnigns below will probably fixed by YAPF.
112     bad-continuation,
113     bad-whitespace,
114     line-too-long,
115     #---------------------------------------------------------------------------
116     # We are light years away from enabling this...
117     missing-docstring,
118     #---------------------------------------------------------------------------
119     # Enabling the two spelling-related checks increases pylints runtime from
120     # 11 min to 40 min, so we better keep those disabled for normal runs.
121     wrong-spelling-in-comment,
122     wrong-spelling-in-docstring,
124 [REPORTS]
125 output-format=cmk_colorized
126 msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
128 [FORMAT]
129 max-line-length=100