Pre-commit hook doesn't respect configuration files
My project has a couple settings defined in our .flake8
file, such as:
[flake8]
max-line-length = 120
When running flake8
directly the options are respected, as one expects. However, I recently used flake8 --install-hook=git
to install the flake8 pre-commit hook. It seems that the flake8 application which is run via the hook does not pick up these settings:
$ git commit
/var/folders/wd/xwtcqngj7kz6sc8ff150dslr0000gn/T/tmp2l2N6g/[FILENAME_ELIDED].py:85:80: E501 line too long (82 > 79 characters)
[...]
I'm not sure if this is intended behavior or a bug. In either case, I'd appreciate some guidance on how to alter the hook to handle simple options.
Thanks for your help.
P.S. I tried duplicating my .flake8
file into the other possible configuration filenames (tox.ini
and setup.cfg
) and did not observe any change in behavior.
====
- Python 2.7.10
- Installed via pip 8.1.2
- Setuptools version 24.0.3
- Flake8 3.0.2 (mccabe: 0.5.1, pyflakes: 1.2.3, pycodestyle: 2.0.0) CPython 2.7.10 on Darwin`