TuringLang / Turing.jl

Bayesian inference with probabilistic programming.
https://turinglang.org
MIT License
2k stars 216 forks source link

Add a pre-commit config #2258

Closed mhauru closed 3 weeks ago

mhauru commented 3 weeks ago

pre-commit is a tool that sets up git pre-commit hooks for you and makes it easy to run them. I added a simple config that checks for basic things like trailing whitespace and invalid TOML files, and runs JuliaFormatter. You can run it on demand with pre-commit run or pre-commit run --all-files, or run pre-commit install and from there on it'll run every time you try to git commit. You do need to install pre-commit through means other than Julia's package manager, such as homebrew, apt, or pip. I think it's cross-platform, but I've never tried it on Windows.

I'll use this myself. Whether it should be in the repo I think depends on whether others want to use it as well, hence this draft PR for discussing. I'm not offended in the slightest if others aren't interested, but figured I would offer this in case it's seen as useful.

torfjelde commented 3 weeks ago

As mentioned in another comment, I'm not a fan of this :confused: https://github.com/TuringLang/Turing.jl/issues/2241#issuecomment-2153075245

devmotion commented 3 weeks ago

Seconded: https://github.com/TuringLang/Turing.jl/issues/2241#issuecomment-2153395963

mhauru commented 3 weeks ago

No problem, I'll close. If anyone ever wants a pre-commit config for themselves I'll point them here.