--exclude flag to the command line
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Undecided
|
Unassigned |
Bug Description
I know that pyflakes doesn't want to add support for excluding errors inside of scripts, but would you be open to adding the --exclude flag to the pyflakes command to exclude files? My situation is this. I want to run pyflakes automatically in the test suite (on Travis CI). However, there are some files that should be ignored (e.g., a compat.py file with a bunch of Python 2/3 compatibility importat that pyflakes gives a bunch of unused import and undefined name warnings for, and a bundled library that uses * imports, but which I'd rather just leave alone). I tried using extended globbing in bash, but it seems it's not so easy to mix multiple !() globs, even with globstar enabled. Anyway, I couldn't figure out how to do it.
I know I can use flake8, but it seems that flake8 --select=F doesn't actually include all pyflakes errors (like syntax errors). I also kind of want to avoid flake8 just to reduce the temptation to test for pep8 errors.
Would it be OK to add --exclude, like flake8 and pep8, which excludes files or directories, to the flake8 command? The --exclude flag in flake8/pep8 accepts a comma separate list of values, which seems kind of dumb to me (it makes more sense to just accept files from the command line, like "pyflakes --exclude compat.py stuff/", which could then be globbed), but I'm OK with keeping it that way if cross-compatibility is a concern.
If there's a bug in Flake8 then please report it there and we'll investigate. I think Phil has been leaning towards the "There's already a tool that does this" camp so I would guess adding --exclude here is a no-go.