mcx
mcx copied to clipboard
Add pre-commit hooks as a dev dependency
I'm a big fan of pre-commit hooks, as they can help avoid stupid mistakes like forgetting to run black
auto formatting or isort
for sorting imports and so on.
As an example of some to start with would be those similar used by PyMC3.
Happy to make a PR for this if it sounds like a good idea.
Just to say I haven't forgotten about this, I just need some time to think about it. I use commit hooks locally too :)
All I can say for now is that we should refer everywhere (even in CI, which I didn't do) to the Makefile to have a single source of truth for the checks and linting.
Oh no hurry, just came to mind as something I use a lot and might be useful for the project, but I think using a Makefile is also a good approach
Or other option would just be to add .pre-commit-config.yaml
to the .gitignore
and just leave the dev dependency and whatever hooks they want to use up to them
I have tried it in the blackjax
repo, and I think it would be a useful addition to mcx
.