mcx icon indicating copy to clipboard operation
mcx copied to clipboard

Add pre-commit hooks as a dev dependency

Open tblazina opened this issue 4 years ago • 4 comments

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.

tblazina avatar Feb 10 '21 06:02 tblazina

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.

rlouf avatar Feb 13 '21 07:02 rlouf

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

tblazina avatar Feb 13 '21 12:02 tblazina

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

tblazina avatar Feb 13 '21 14:02 tblazina

I have tried it in the blackjax repo, and I think it would be a useful addition to mcx.

rlouf avatar Jul 29 '21 16:07 rlouf