I find pylint
useful, but I also find it is horrifically undocumented, has painfully verbose output, and lacks an intuitive interface.
I'd like to use pylint, but it keeps pumping out an absurd number of pointless 'convention' messages, e.g. C: 2: Line too long (137/80)
etc.
If I could disable these, pylint would be much more usable for me. How does one disable these 'convention' messages?
I've tried putting disable-msg=C301
in ~/.pylintrc
(which is being loaded because when I put an error in there pylint
complains) which I understand to be the "Line too Long" message based on running this command in the pylint package directory (documentation that can be found would be nice):
$ grep "Line too long" **/*.py checkers/format.py: 'C0301': ('Line too long (%s/%s)',
Yet this disable-msg
does nothing. I'd disable the entire convention
category with the disable-msg-cat=
command, but there's no indication anywhere I can find of what an identifier of the convention
category would be for this command — the intuitive disable-message-cat=convention
has no effect.
I'd be much obliged for some direction on this issue.
Thank you.
Brian
This may be done by adding # pylint: disable=some-message,another-one at the desired block level or at the end of the desired line of code.
You can easily toggle between enabling and disabling your linter. To switch, open the Command Palette (Ctrl+Shift+P) and select the Python: Enable/Disable Linting command. This will populate a dropdown with the current linting state and options to Enable or Disable Python linting.
If you want to disable specific warnings only, this can be done by adding a comment such as # pylint: disable=message-name to disable the specified message for the remainder of the file, or at least until # pylint: enable=message-name .
you can ignore it by adding a comment in the format # pylint: disable=[problem-code] at the end of the line where [problem-code] is the value inside pylint(...) in the pylint message – for example, abstract-class-instantiated for the problem report listed above.
If I'm not mistaken, you should be able to use --disable-msg-cat=C
(can't remember whether it's uppercase or lowercase or both) to accomplish this.
UPDATE: In later versions of pylint, you should use --disable=C
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With