Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pylint: configuration to disable certain warnings

I'm trying to use vscode with pylint for my Python needs. It works quite well but one thing I don't like is some of the python complaints. E.g:

  1. Invalid variable names. In short methods or short loops (< 5 lines). I use one character variable names like d for dict and l for line.
  2. Missing doc string.

Coding style argument aside, I'd like an option to turn this off. It looks like I can do this with pylint command line option. But I'd like to make it into configuration that can be reflected in vscode.

How can I do that?

like image 307
lang2 Avatar asked May 13 '17 02:05

lang2


People also ask

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 get Pylint to ignore a 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 .


1 Answers

I found this answer helpful on setting up a config file.

Basically, add the following to a .pylintrc file in your home directory.

[MESSAGES CONTROL]
disable=C0103
like image 146
alex Avatar answered Oct 08 '22 08:10

alex