-
Notifications
You must be signed in to change notification settings - Fork 22
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 configuration #48
Conversation
@Zeitsperre What's the best way to test this on my local? Should we add a check for mypy too? #47 has been approved, so feel free to merge PyDocStyle sounds very opinionated, we should discuss the advantages in another PR. |
To configure pre-commit in the repo:
This will make it so that anytime you commit a file, the pre-commit linters and checkers will run automatically. To run the checks manually:
We can! And will do!
Thanks!
Sounds good to me. The documentation conventions/style can be different depending on preferences. I'm partial to numpy-docstyle conventions, but others are supported. Will open an issue concerning it. |
Should we add And perhaps some instructions on how to use it? Maybe there's a way to initiate |
BTW, I've tested it and it looks like it will be a handy tool; especially to save some time when waiting for CI on GitHub just for it to fail (eg mypy). |
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.
Feel free to merge - but at the very least we should mention the pre-commit option in the CONTRIBUTING doc
Hi @KipCrossing sorry for the delay! In terms of time-saving, pre-commit is fantastic, and I've integrated it into many of the projects I help run. I can copy-paste some explanatory flavour text into the docs somewhere in this PR. I like your idea of installing pre-commit when one makes a Edit: Looks like there's a suggestion in the docs https://pre-commit.com/#automatically-enabling-pre-commit-on-repositories Edit 2: Some discussions within the pre-commit issues talk about how it would be a bit overarching to install pre-commit on clone/install. The better approach is to be clear in the dev docs about how to effectively contribute. |
Closes #46.
What does this introduce?
Pre-commit is a tool for running checks on code changes prior to committing them, preventing errors and inconsistencies from being introduced. I've added a pretty simple configuration that does a handful of things:
# noqa
statementsI've also added, but commented out, a few checks that require some effort.