Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding directory

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.

like image 532
user3148949 Avatar asked Jun 30 '14 16:06

user3148949


People also ask

How do I find and exclude a directory?

To exclude multiple directories, OR them between parentheses. And, to exclude directories with a specific name at any level, use the -name primary instead of -path .

How do I exclude a directory in find command?

We can exclude directories by using the help of “path“, “prune“, “o” and “print” switches with find command. The directory “bit” will be excluded from the find search!

How do you exclude a directory in ls?

without directories — and here it is. Adding -ls or -exec ls -l {} \; would make it like ls -l without directories. find .

What is exclude file?

If you exclude a file from a Web Site project (not Web Application), Visual Studio will simply add the . exclude extension to that file. If you remove the extension, that file will be included again. It's up to you if you still need those files or not.


2 Answers

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__) 
like image 109
alecxe Avatar answered Sep 19 '22 10:09

alecxe


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

like image 38
johntellsall Avatar answered Sep 21 '22 10:09

johntellsall