代码之家  ›  专栏  ›  技术社区  ›  Brian M. Hunt

Disable all `pylint` 'Convention' messages

  •  17
  • Brian M. Hunt  · 技术社区  · 16 年前

    背景

    我发现 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've tried putting disable-msg=C301 在里面 ~/.pylintrc (which is being loaded because when I put an error in there 皮林特 投诉),我理解这是基于在pylint package目录中运行此命令的“行太长”消息(可以找到的文档很好):

    $ grep "Line too long" **/*.py checkers/format.py: 'C0301': ('Line too long (%s/%s)',

    然而这 disable-msg 什么也不做。I'd disable the entire convention category with the disable-msg-cat= 命令,但没有迹象表明我在哪里可以找到一个标识符。 惯例 category would be for this command — the intuitive disable-message-cat=convention 没有效果。

    谢谢您。

    布瑞恩

    1 回复  |  直到 11 年前
        1
  •  16
  •   SleepyCal    11 年前

    如果我没弄错,你应该能用 --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

    推荐文章