How do I disable a Pylint specific error message globally?

倖福魔咒の 提交于 2020-08-04 02:45:55

问题


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?


回答1:


In order for pylint to automatically pick up your rc file, it should be located at ~/.pylintrc. Otherwise you would need to pass the rc file as an argument on every invocation of pylint.




回答2:


pylint --generate-rcfile > ~/.pylintrc

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




回答3:


Alternative add disable=C0103 to .pylintrc this will ignore for the current directory or workspace.



来源:https://stackoverflow.com/questions/23201968/how-do-i-disable-a-pylint-specific-error-message-globally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!