7

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.

Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
Thorin Schiffer
  • 2,818
  • 4
  • 25
  • 34
  • 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 Answers3

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
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