我正在使用 pydev,我已经设置了 pylint。
问题是,即使在评论中,pylint 也会报告警告。我希望禁用任何行或块注释内的任何类型的检查。
另外,我希望遵循驼峰命名约定,而不是代码中变量和参数的下划线。
有没有办法指定这样的规则,而不用任何 pylint: 禁用注释插入我的代码?
您可以使用全局禁用特定类别的警告
pylint --disable=W1234
或者使用特殊的 PyLint 配置文件
pylint --rcfile=/path/to/config.file
下面给出了示例配置文件:
[MESSAGES CONTROL]
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
# W0704 Except doesn't do anything Used when an except clause does nothing but "pass" and there is no "else" clause
# W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
# W0212 Access to a protected member %s of a client class
# W0232 Class has no __init__ method Used when a class has no __init__ method, neither its parent classes.
# W0613 Unused argument %r Used when a function or method argument is not used.
# W0702 No exception's type specified Used when an except clause doesn't specify exceptions type to catch.
# R0201 Method could be a function
# W0614 Unused import XYZ from wildcard import
# R0914 Too many local variables
# R0912 Too many branches
# R0915 Too many statements
# R0913 Too many arguments
# R0904 Too many public methods
disable=C0111,I0011,I0012,W0704,W0142,W0212,W0232,W0613,W0702,R0201,W0614,R0914,R0912,R0915,R0913,R0904,R0801
See 文档 http://docs.pylint.org于Pylint 的专用网站 http://www.pylint.org.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)