Em,你可以逐行添加你的配置,我在我的项目中使用它。
pylint 将关键字解释disable
为:
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
如果您可以禁用其他人,例如,我的项目,pylint 给我这些信息,
C0116: Missing function or method docstring (missing-function-docstring)
R0201: Method could be a function (no-self-use)
R1705: Unnecessary "elif" after "return" (no-else-return)
但我想忽略三个消息,所以我将它们添加到disable
标签中,就像这样
disable=unnecessary-lambda,
no-else-return,
too-many-branches
然后 pylint 不报告 hte 三个消息