I have a problem with pylint, i.e. sometimes it repeats the same message for some variable/class/module etc. and I can't find a workaround for that. What I want is to say pylint "don't check [message XXX|any message] for variable YYY in [this module|module "ZZZ"]" with some option or rcfile directive.
Asked
Active
Viewed 1.1k times
7
-
You can ignore all `pylint` checks for the specific variable via the `dummy-variables` configuration: stackoverflow.com/a/50118061/1814353 – luart May 01 '18 at 14:21
-
Maybe you mean `# pylint: disable=invalid-name` in the affected class? – Sukombu Jul 05 '22 at 17:27
3 Answers
8
There's good-names=YYY
for this, or for some advanced stuff you can modify the regex via variable-rgx
.

Tobias Kienzler
- 25,759
- 22
- 127
- 221
5
According to the docs you enable and disable messages using lines like:
# pylint: disable=W0631
in the python code.

f p
- 3,165
- 1
- 27
- 35
-
I know this feature, but i meant something like this `# pylint: disable-msg=W0631 for variable foo` in the beginning of the file – Thorin Schiffer Jan 09 '13 at 11:26
-
-
1
2
What you are asking for is not supported in the current version of Pylint.
You may want to get in touch with the maintainers and propose them a feature request and an implementation.

gurney alex
- 13,247
- 4
- 43
- 57
-
Doesn't [`good-names`](http://docs.pylint.org/features.html#basic-checker) fit the bill quite well? – Tobias Kienzler Aug 02 '13 at 06:11