如何禁用Pylint警告?
我正在尝试在Pylint 0.21.1中禁用警告C0321(“在一行上有多个语句”
–我经常将if
带有短单行结果的语句放在同一行上)(如果重要:astng 0.20)。 1,常见的0.50.3,Python
2.6.6(r266:84292,2010年9月15日,16:22:56))。
我尝试添加disable=C0321
Pylint配置文件,但是Pylint坚持要报告它。该行的变体(如disable=0321
或disable=C321
)被标记为错误,因此Pylint
确实 正确识别了该选项,只是忽略了它。
这是Pylint的错误,还是我做错了什么?有没有办法解决?我真的很想摆脱这种噪音。
-
pylint --generate-rcfile
显示如下:[MESSAGES CONTROL] # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time. #enable= # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). #disable=
因此,看起来您
~/.pylintrc
应该disable=
在section中有一行[MESSAGES CONTROL]
。