alexcouper / captainhook

Git hook scripts
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

`flake8` checkers overrides tox.ini defaults #17

Closed OddBloke closed 10 years ago

OddBloke commented 10 years ago

We (unsurprisingly) don't care about our migrations passing flake8.

Unfortunately, in passing a list of files to flake8, the checker overrides our tox.ini settings (as it's running e.g. flake8 ott/team/migrations/0014_auto__add_field_teammemberabsence_working_days_absent.py ott/team/models.py).

Might it be worth hooking directly in to the flake8 git hook?

OddBloke commented 10 years ago

Actually, that's probably overkill (as it moves all of the modified files in to a temporary directory). The below lines are probably the interesting ones from that:

from flake8.main import DEFAULT_CONFIG

flake8_style = get_style_guide(config_file=DEFAULT_CONFIG, paths=['.'],
                                   **options)
report = flake8_style.check_files(files_to_check)
OddBloke commented 10 years ago

I'm looking at this now.