Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable all `pylint` 'Convention' messages

Tags:

python

pylint

Background

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.

Question

If I could disable these, pylint would be much more usable for me. How does one disable these 'convention' messages?

My own efforts

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

like image 517
Brian M. Hunt Avatar asked Jun 26 '10 20:06

Brian M. Hunt


People also ask

How do I stop Pylint messages?

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.

How do I disable Vscode Pylint warnings?

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.

How do I ignore Pylint errors in file?

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 .

How do I disable Pylint in line?

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.


1 Answers

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

like image 102
mattbasta Avatar answered Sep 30 '22 18:09

mattbasta