I'm trying to run flake8 in a pre-commit hook on only the changed files in my git diff, while also excluding files in my config file.
files=$(git diff --cached --name-only --diff-filter=ACM);
if flake8 --config=/path/to/config/flake8-hook.ini $files; then
exit 1;
fi
I'm essentially wanting to do:
flake8 --exclude=/foo/ /foo/stuff.py
And then have flake8 skip the file that I passed in because it is in the exclude variable.
I'm also wanting it to exclude files that are not .py files. For example:
flake8 example.js
Right now as I'm testing, neither of these work. Anyone have any ideas?