26

我正在开发一个 django 项目,并试图在其中的应用程序上运行 pyflakes。我需要从 pyflakes 中排除“迁移”目录。

对于 pep8 我可以做

pep8 --exclude=migrations app_name

pyflakes 有没有类似的方法?

我找不到任何合适的 pyflakes 文档。

4

2 回答 2

46

改用flake8tool - 它是pyflakes,pep8mccabe.

除了其他功能,它还有一个--exclude选项:

--exclude=patterns    exclude files or directories which match these comma
                      separated patterns (default:
                      .svn,CVS,.bzr,.hg,.git,__pycache__)
于 2014-06-30T16:52:44.810 回答
4

Pyflakes 支持文件或目录列表;没有“排除”选项

这是一个等价物:

pep8 `find app_name | egrep -v migrations`

pyflakes 手册页:http ://man.cx/?page=pyflakes&do%5Bgo%5D=go

于 2014-06-30T16:52:06.743 回答