28

I am working on a django project and am trying to run pyflakes on an app in it. I need to exclude the "migrations" directory from pyflakes.

For pep8 I can do

pep8 --exclude=migrations app_name

Is there any similar way for pyflakes?

I couldn't find any proper documentation for pyflakes.

user3148949
  • 578
  • 1
  • 9
  • 22

2 Answers2

49

Use flake8 tool instead - it is a wrapper around pyflakes, pep8 and mccabe.

Besides other features, it has an --exclude option:

--exclude=patterns    exclude files or directories which match these comma
                      separated patterns (default:
                      .svn,CVS,.bzr,.hg,.git,__pycache__)
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
6

Pyflakes supports a list of files or directories; no "exclude" option

Here's an equivalent:

pep8 `find app_name | egrep -v migrations`

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

johntellsall
  • 14,394
  • 4
  • 46
  • 40