禁用所有“pylint”“约定”;消息
背景
我发现 pylint
很有用,但我也发现它没有文档记录,输出非常冗长,而且缺乏直观的界面。
我想使用 pylint,但它不断地输出大量毫无意义的“约定”消息,例如 C: 2: Line too long (137/80)
等。
问题
如果我可以禁用这些,pylint 对我来说更有用。如何禁用这些“约定”消息?
我自己
尝试将 disable-msg=C301
放入 ~/.pylintrc
(正在加载,因为当我在其中放置错误 pylint< /code> 抱怨),我理解这是基于在 pylint 包目录中运行此命令的“行太长”消息(可以找到的文档会很好):
$ grep“行太长”**/*。 py checkers/format.py: 'C0301': ('行太长 (%s/%s)',
但是这个 disable-msg
没有任何作用。我会禁用整个 约定< /code> 类别与
disable-msg-cat=
命令,但没有任何迹象表明我可以找到该命令的 convention
类别的标识符 -直观的 disable-message-cat=convention
没有效果,
在这个问题上的指导。
我非常感谢
布莱恩
Background
I find pylint
useful, but I also find it is horrifically undocumented, has painfully verbose output, and lacks an intuitive interface.
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.
Question
If I could disable these, pylint would be much more usable for me. How does one disable these 'convention' messages?
My own efforts
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 "Line too long" **/*.py
checkers/format.py: 'C0301': ('Line too long (%s/%s)',
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.
Thank you.
Brian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没有记错的话,您应该能够使用
--disable-msg-cat=C
(不记得它是大写还是小写还是两者)来完成此操作。更新:在 pylint 的更高版本中,您应该使用
--disable=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.UPDATE: In later versions of pylint, you should use
--disable=C