7019 FIX NagVis: Updated to 1.9.11
[check_mk.git] / .pylintrc
bloba4d22a99437cf452866114a88477ba93dfac27fd
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_wrong_i18n
18 load-plugins=testlib.pylint_cmk,testlib.pylint_checker_localization
19 jobs=0
20 persistent=yes
21 # We only want to see errors for the moment. Disable this one day. But prepare to cleanup a lot of stuff.
22 errors-only=yes
24 [MESSAGES CONTROL]
25 # C0111 missing module docstring
26 # C0326 bad-whitespace
27 # unsubscriptable-object
28 # unsupported-membership-test
29 # unpacking-non-sequence
30 #   Disable this because we often use multiple types for a single variable. Maybe we
31 #   can change this in future to make such linter checks work, but for the moment these
32 #   checks are useless with Check_MK.
33 disable=C0111,bad-whitespace,unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
34 # W0612: Unused variable
35 # TODO: enable this and prepare code for it!
36 # -unused-variable
37 # - bad-indentation,mixed-indentation,unnecessary-semicolon
38 # - redefined-builtin
39 # - global-variable-undefined
40 # - unused-import
41 # - spelling? (need python-enchant, enchant packages)
42 # https://pylint.readthedocs.io/en/latest/reference_guide/features.html
43 enable=unreachable,dangerous-default-value,duplicate-key,using-constant-test,duplicate-except,binary-op-exception,overlapping-except,non-parent-init-called,super-init-not-called,no-init,bad-open-mode,redundant-unittest-assert,boolean-datetime,deprecated-method,nonstandard-exception,import-self,global-variable-not-assigned,undefined-loop-variable,lost-exception,property-on-old-class
45 [TYPECHECK]
46 # rrdtool
47 #   Can not check methods / attributes of the rrdtool C module. Skipping related errors
48 #   like the following:
49 #   [E1101(no-member), create_rrd] Module 'rrdtool' has no 'create' member
50 # ldap
51 #   The Python ldap module gets a lot of constants from the C API which can not be found by pylint.
52 #   This results in a lot of these errors: "Module 'ldap' has no 'OPT_REFERRALS' member".
53 # netifaces
54 #   Can not check methods / attributes of the netifaces C module
55 ignored-modules = rrdtool,ldap,netifaces
57 [REPORTS]
58 output-format=cmk_colorized
59 msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
61 [FORMAT]
62 max-line-length=100
63 single-line-if-stmt=no
64 indent-string='    '
66 [VARIABLES]
67 # Ignore these unused variables (e.g. _no_item,_no_params)
68 dummy-variables-rgx=^_.*
69 # Needed by web code because of super globals. TODO Clean this up some day
70 additional-builtins=html,_,_u,current_language,HTML
72 [MISCELLANEOUS]
73 # List of note tags to take in consideration, separated by a comma.
74 notes=FIXME,TODO
76 [SPELLING]
77 spelling-dict=en_US
78 # List of comma separated words that should not be checked.
79 spelling-ignore-words=
80 # A path to a file that contains private dictionary; one word per line.
81 #spelling-private-dict-file=
82 # Tells whether to store unknown words to indicated private dictionary in
83 # --spelling-private-dict-file option instead of raising a message.
84 #spelling-store-unknown-words=no