https://pantsbuild.org/ logo
#general
Title
# general
r

refined-addition-53644

03/05/2022, 12:04 PM
What would be the best way to use pants as pre-commit hooks for linting and formatting? Just write a custom bash script to call pants ?
w

wide-midnight-78598

03/05/2022, 2:17 PM
There may be other ways, but if you need an example of using pre-commit hooks with pants, you can look at the main repo: https://github.com/pantsbuild/pants/tree/main/build-support/githooks https://www.pantsbuild.org/docs/contributor-setup#step-2-set-up-git-hooks You can, naturally, trim this down to your specific use case - since there is a lot of Pants/Rust-specific stuff in here, but I use that folder of the repo as inspiration for my githooks
👍 2
5 Views