celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/
Other
65 stars 35 forks source link

Add git pre-commit hook #1329

Closed esseivaju closed 4 months ago

esseivaju commented 4 months ago

Some errors are easy to overlook during review but could be validated with a git hook. Add a pre-commit script that will parse staged files in corecel for includes of any upstream library. This could easily be extended with more checks. Alternatively, this could be added to the CI

esseivaju commented 4 months ago

Thanks, this looks like a definite step in the right direction. I wonder if we should start using/requiring https://pre-commit.com which can manage git hooks more cleanly than the script I hacked together?

This looks interesting but C++ is not in the list of supported languages so we'd only use that to manage our custom git hooks?

sethrj commented 4 months ago

@esseivaju I think https://github.com/pre-commit/mirrors-clang-format?tab=readme-ov-file ?

esseivaju commented 4 months ago

@esseivaju I think https://github.com/pre-commit/mirrors-clang-format?tab=readme-ov-file ?

Ah right, yes I think it would be nice to integrate this at some point.