以下来自Pylint 文档:
--ignore=<file>
Add <file or directory> to the black list. It should be a
base name, not a path. You may set this option multiple
times. [current: %default]
然而,我没有运气让目录部分工作。
我有一个名为migrations的目录,其中包含 django-south 迁移文件。当我输入 --ignore=migrations 时,它仍然不断地给我迁移目录中的文件中的错误/警告。
难道它--ignore
不适用于目录?
如果我什至可以使用正则表达式来匹配被忽略的文件,它会起作用,因为 django-south 文件都被命名为 0001_something, 0002_something...
由于我无法通过目录忽略工作,我只好简单地放在# pylint: disable-msg-cat=WCREFI
每个迁移文件的顶部,这会忽略所有 Pylint 错误、警告和信息。