Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable a Pylint specific error message globally?

I'm using Sublime Text editor with Pylint as a Python code parser. It works fine, BUT whenever I define a variable, I receive the following error message (C0103):

Error: invalid constant name.

I read in this topic that one solution could be adding a # pylint: disable-msg=C0103 to the source code, but this solution isn't enough for me because I have a lot of variable definitions and I don't want to polute my code with calls to Pylint. I need to disable error message C0103 for good, globally, in ALL my Python's source files. I must get rid of this message forever. How can I accomplish this?

like image 754
renatov Avatar asked Apr 21 '14 17:04

renatov


People also ask

How do I disable Pylint errors?

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. 4.2 Is there a way to disable a message for a particular module only? You can disable messages by: numerical ID: E1101 , E1102 , etc.

How do I remove Pylint from the whole 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 Vscode Pylint warnings?

Disable linting 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 a folder in Pylint?

Since I could not get the ignore by directory to work, I have resorted to simply putting # pylint: disable-msg-cat=WCREFI on top of each migration file, which ignores all Pylint errors, warnings, and information.


1 Answers

pylint --generate-rcfile > ~/.pylintrc

Then add "disable": "C0103" to this file.

like image 60
renatov Avatar answered Oct 20 '22 04:10

renatov