禁用所有“pylint”“约定”;消息

发布于 2024-09-07 07:56:50 字数 760 浏览 4 评论 0原文

背景

我发现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

×纯※雪 2024-09-14 07:56:50

如果我没有记错的话,您应该能够使用 --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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文