-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add precommit
#76
Add precommit
#76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks for contributing. If there is a way to add pytest
, but turn it off by default, I think it would also be very useful. But that does not necessarily need to be done in the same PR
- id: end-of-file-fixer | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 21.5b1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this just to match the current version enforced in the CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's the option of turning off git hooks with git commit --no-verify -m '<insert-commit-message>'
. But that's a hack IMO. I didn't pytest
because I noticed that the repository already has CI that runs on every PR which also runs pytest
.
PS: Apparently there are some files which are corrected by |
Fixes #75.
Based on the feedback provided by @streeve I've added
black
among some other miscellaneous checks to the.pre-commit-config.yaml
. I've also addedpre-commit
to therequirements-dev.txt
file in order to aid new contributors.I have not added
pytest
as of right now based on the feedback provided but more than happy to take that up again.I'd also recommend adding instructions on how to install pre-commit hooks to the
CONTRIBUTING.md
file.