My team uses Pre-commit in our repositories to run various code checks and formatters. Most of my teammates use it but some skip it entirely by committing with git commit --no-verify
. Is there anyway to run something in CI/CD to ensure all Pre-commit hooks pass (we're using GitHub actions). If at least one hooks fails, then throw an error.
There are several choices:
pre-commit run --all-files
as demonstrated in pre-commit.com docs (you probably also want --show-diff-on-failure
if you're using formatters)disclaimer: I created pre-commit, and pre-commit.ci, and the github action