禁用所有“pylint"“约定"消息 [英] Disable all `pylint` 'Convention' messages
问题描述
我发现 pylint
很有用,但我也发现它没有文档记录,令人痛苦的冗长输出,并且缺乏直观的界面.
I find pylint
useful, but I also find it is horrifically undocumented, has painfully verbose output, and lacks an intuitive interface.
我想使用 pylint,但它不断输出大量无意义的约定"消息,例如C: 2: Line too long (137/80)
等
I'd like to use pylint, but it keeps pumping out an absurd number of pointless 'convention' messages, e.g. C: 2: Line too long (137/80)
etc.
如果我可以禁用这些,pylint 对我来说会更有用.如何禁用这些约定"消息?
If I could disable these, pylint would be much more usable for me. How does one disable these 'convention' messages?
我已经尝试将 disable-msg=C301
放入 ~/.pylintrc
(它正在加载,因为当我在其中放入错误时 pylint
抱怨),我理解这是基于在 pylint 包目录中运行此命令的行太长"消息(可以找到的文档会很好):
I've tried putting disable-msg=C301
in ~/.pylintrc
(which is being loaded because when I put an error in there pylint
complains) which I understand to be the "Line too Long" message based on running this command in the pylint package directory (documentation that can be found would be nice):
$ grep "行太长" **/*.pycheckers/format.py: 'C0301': ('行太长 (%s/%s)',
$ grep "Line too long" **/*.py checkers/format.py: 'C0301': ('Line too long (%s/%s)',
然而这个 disable-msg
没有任何作用.我会使用 disable-msg-cat=
命令禁用整个 convention
类别,但没有任何迹象表明我可以找到 convention 的标识符
类别将用于此命令 —直观的 disable-message-cat=convention
没有效果.
Yet this disable-msg
does nothing. I'd disable the entire convention
category with the disable-msg-cat=
command, but there's no indication anywhere I can find of what an identifier of the convention
category would be for this command — the intuitive disable-message-cat=convention
has no effect.
我非常乐意就这个问题提供一些指导.
I'd be much obliged for some direction on this issue.
谢谢.
布莱恩
推荐答案
如果我没记错的话,你应该可以使用 --disable-msg-cat=C
(不能请记住是大写还是小写或两者兼而有之)来完成此操作.
If I'm not mistaken, you should be able to use --disable-msg-cat=C
(can't remember whether it's uppercase or lowercase or both) to accomplish this.
更新:在更高版本的 pylint 中,您应该使用 --disable=C
UPDATE: In later versions of pylint, you should use --disable=C
这篇关于禁用所有“pylint"“约定"消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!