Excluding directory

user3148949 picture user3148949 · Jun 30, 2014 · Viewed 12.3k times · Source

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.

Answer

alecxe picture alecxe · Jun 30, 2014

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__)