Pre-commit Quality Gates
Block bad commits with shared, automated hooks.
0 of 6 steps
What you will end up with
Shared pre-commit hooks
Automated lint and format
Secret scanning on commit
Build steps
0/6Install pre-commit, then run pre-commit install so it wires itself into your local git hooks. This installs a doorman who checks every commit before it is allowed to walk in.
Add a config file listing hooks for linting and formatting, pinned to specific versions. Each hook is one specific thing the doorman checks, like shoes on or ID visible.
Add a secret-scanning hook so any commit containing something that looks like an API key gets blocked outright. This is the doorman patting down for anything that looks like a stolen key before it leaves the building.
Commit the hook config to the repo so everyone who clones it gets identical checks after one install command. Everyone’s doorman reads from the same rulebook instead of making up their own rules.
Add a CI step that runs the same hooks again, catching anyone who skipped or bypassed them locally. This is the second doorman at the loading dock, in case someone snuck past the front desk.
Add a short README section explaining how to install the hooks and what to do if one blocks a commit. A sign by the door explaining the rules, so nobody is confused about why they got stopped.
Before you start