26

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

Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
  • I would like to note, that long lines are not a "pointless convention" though. I need to be able to do a side by side comparison of code inside my IDE, e.g. for merges or reviews, and long lines make that harder. Furthermore, trying to avoid long lines encourages writing less complex code by putting stuff into variables instead of chaining functions forever. – sezanzeb Feb 14 '21 at 11:17

1 Answers1

32

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

SleepyCal
  • 5,739
  • 5
  • 33
  • 47
mattbasta
  • 13,492
  • 9
  • 47
  • 68
  • 11
    Thanks for the reply. I discovered the problem: The version of Pylint I have, for no apparent reason, uses `disable=...`. When you put `disable=C` in `~/.pylintrc` (or `--disable=C` from the command line) this works. – Brian M. Hunt Jun 26 '10 at 21:16
  • 2
    @BrianM.Hunt you should post this comment as an answer. – Jace Browning Jul 11 '13 at 04:06
  • 2
    in your `pylintrc` you can have `disable=C,W` and it disables all warnings and comments. – Trevor Boyd Smith Mar 30 '17 at 15:21
  • 2
    I wrote up a lengthy answer on this topic and posted it [here](http://stackoverflow.com/a/43510297/2063640). Maybe it will be useful to some people. – eatcrayons Apr 20 '17 at 04:43