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

Pre-commit hook options in CookieCutter #46

Open
AndreasThinks opened this issue Sep 7, 2021 · 2 comments
Open

Pre-commit hook options in CookieCutter #46

AndreasThinks opened this issue Sep 7, 2021 · 2 comments

Comments

@AndreasThinks
Copy link

So I've started removing the Flake8 pre-commit hook...it is just too militant, and the fact I can't commit any line over 79 characters really isn't improving my code an awful lot, especially as we already have Black.

I was wondering if we could consider which pre-commits were necessary, and remove the rest? Commit failing is a pain.

@jamesmyatt
Copy link

flake8 should be configured to match black, otherwise they will fight each other. https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8

@ESKYoung
Copy link
Collaborator

ESKYoung commented Sep 7, 2021

I believe the flake8 settings are already set up for compatibility with black - see the .flake8 file in the {{ cookiecutter.repo_name }} folder of the main branch.

@AndreasThinks - not necessarily a solution to your problem, but you should be able to modify the configuration of black to change the line width.

Regarding flake8 itself, it runs additional PEP8 checks not covered by black, which only really covers formatting. For example, I don't think black picks up on unused imports, but flake8 will!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants