rlouf / mcx

Express & compile probabilistic programs for performant inference on CPU & GPU. Powered by JAX.
https://rlouf.github.io/mcx
Apache License 2.0
325 stars 17 forks source link

Add pre-commit hooks as a dev dependency #80

Open tblazina opened 3 years ago

tblazina commented 3 years ago

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.

rlouf commented 3 years ago

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.

tblazina commented 3 years ago

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 commented 3 years ago

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

rlouf commented 3 years ago

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