-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
WIP | Add pre-commit #673
WIP | Add pre-commit #673
Conversation
This looks like a great start! Would you consider using darker given it's obscure enough? I am still on the Also it looks like |
Thanks for doing this. This does add another way of doing precommits, we already use husky for JS and I don't think they play nicely together. I personally also prefer how Husky just adds the formatted code to your commit, rather than failing and having to manually add the code back. The other nice thing is it 'just works', without manually having to install something. |
@timgl Yeah, |
@timgl Husky requires a package manager, and NodeJS to run hooks. This way, backend engineers would need to set up (and maintain) the frontend ecosystem. Pre-commit, on the other side, just works. It supports a whole variety of scripts, no matter the programming language they use. Not sure how to use backend-oriented hooks with Husky, however, pre-commit supports several frontend-oriented ones, not to mention eslint, tslint, prettier... |
Happy either way! I do think we should make sure this PR doesn't break frontend formatting. |
@Pacu2 Hello again, sorry this has stalled for a while. Do you still have interest in picking this up? |
@timgl sure will do in 24h |
This was done in #1043, but really appreciate the work! |
Adding simple pre-commit as discussed in #660
Unfortunately, darker does not support pre-commit yet but opened a related pull request to change it in akaihola/darker#2
To enable pre-commit one needs simply:
python -m pip install -r requirements/dev.txt
pre-commit install
this PR consists of 3 commits: