如何在pylint-1.0.0之后显示Pylint消息ID?

Jac*_*ing 23 pylint

与启动pylint-1.0.0--include-ids不再允许争论.

如何得到:

************* Module foo.bar
E:199,11: Module 'yaml' has no 'scanner' member (no-member)
************* Module foo.baz
W:153,27: Unused variable '_filenames' (unused-variable)
Run Code Online (Sandbox Code Playgroud)

为每个警告显示ID(例如W0142)?

r3m*_*m0t 28

指定此方法的新方法是命令行参数'--msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'.

  • 哇,很酷:而不是'--include-ids = y'我现在必须写'' - msg-template = {path}:{line}:[{msg_id}({symbol}),{obj}] {msg}''现在这很简单直观!:-)不是你的错我知道,谢谢你的回答. (11认同)
  • @JohannesOvermann,您现在可以根据符号名称而不是代码禁用错误(例如`#pylint:disable = redefined-outer-name`) (4认同)
  • @JaceBrowning https://bitbucket.org/logilab/pylint/src/02db08561a8ef462ca7279c12916e54eb362d47d/reporters/__init__.py?at=default#cl-40 (2认同)