Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake8 ignores exclude configuration when used through pre-commit hooks #52

Open
merfolk opened this issue Apr 20, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@merfolk
Copy link
Collaborator

merfolk commented Apr 20, 2020

Describe the bug
When sharpy-sc2's pre-commit hooks are installed, flake8 will ignore excludes configured in .flake8 file.

This is by design, and pre-commits exclude should be used instead.

Checked-in python files will be passed as positional arguments. flake8 will always lint explicitly passed arguments (flake8 --exclude has no effect). Instead use pre-commit’s exclude: ... regex to exclude files. pre-commit won’t ever pass untracked files to flake8 so excluding .git / .tox / etc. is unnecessary.

https://flake8.pycqa.org/en/latest/user/using-hooks.html

Expected behavior
Flake8 should work in similar way, whether launched with eg. py -m flake8 or by the pre-commit hooks (installed by pre-commit install).

Additional context

sharpy-sc2 repo already contains multiple config files with the same excludes.

  1. .flake8
  2. pyproject.toml for Black config
  3. pytest.ini

Adding a fourth file with the same excluded directories would be... less than ideal.

@merfolk merfolk added the bug Something isn't working label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant