Not the OP, but I've worked on a bunch of projects which use https://pre-commit.com/ that ties into git pre-commit hooks (or https://typicode.github.io/husky/#/ is another)
usually to run linters and validators, speeding up the feedback loop (otherwise it's annoying to push changes to a PR and then get a CI failure minutes later for trivial linting issue)