Git hook runs on omitted files
3.0.4 (pyflakes: 1.2.3, mccabe: 0.5.2, pycodestyle: 2.0.0) CPython 3.5.2 on Linux
I'm developing a Django project, and I have the following
[flake8] exclude = env/, migrations/, # exclude tox so flake8 doesn't explode .tox/
I have also installed the git hook using
flake8 --install-hook git, which created the following hook.
#!/home/<username>/programs/python/django/django-timetracker/env/bin/python3 import os import sys from flake8.main import git if __name__ == '__main__': sys.exit( git.hook( strict=git.config_for('strict'), lazy=git.config_for('lazy'), ) )
The issue I'm having is that when I try to commit code in the
migrations folder that has a line longer than 79 characters, flake8 complains and cancels the commit. However, if I run
flake8 . from the command line, no errors are reported.
I have tried to delete and reinstall the hook, I've tried various patterns for the exclusion like
timetracker/migrations/, etc., and I've tried removing the file from git's staging and adding it back in. It still throws a line length error.