以下是来自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]
Run Code Online (Sandbox Code Playgroud)
然而,我没有运气让目录部分工作.
我有一个名为migrations的目录,它有django-south迁移文件.当我输入--ignore = migrations时,它仍然会在迁移目录中的文件中向我提供错误/警告.
难道这--ignore不适用于目录吗?
如果我甚至可以使用regexp来匹配被忽略的文件,那么django-south文件都被命名为0001_something,0002_something ...
由于我无法通过目录来忽略工作,我只是简单地放在# pylint: disable-msg-cat=WCREFI每个迁移文件的顶部,忽略所有的pylint错误,警告和信息.