DevOps

pre-commit Config Generator

Generate a .pre-commit-config.yaml with formatters, linters, secret scanning and file hygiene hooks for your languages, pinned to revisions and wired for CI.

Last reviewed by the Radiatus Cloud team

Configuration appears here.

Want this automated for your stack?

We build CI/CD, Kubernetes & IaC pipelines that scale.

Talk to an engineer

Catch it before it is committed, not in review

A formatting argument in code review is a waste of two people's attention, and a secret committed to a repository is permanent even after it is removed, because the object stays in history and in every clone. pre-commit runs checks against staged files before the commit is created, which is the last moment at which either problem is cheap to fix. The framework handles installing each tool in an isolated environment, so contributors do not need to install linters themselves.

Pin revisions or the hooks change under you

Each hook repository is referenced by a revision. Pointing at a branch means a formatter update can reformat the entire codebase during someone's unrelated commit, and a linter update can fail a build that passed an hour earlier. Pinning to a tag makes hook behaviour reproducible, and pre-commit autoupdate bumps them deliberately when you choose. This is the same argument as pinning any other dependency and it is skipped just as often.

Local hooks are advisory, CI is authoritative

A developer can bypass any hook with the no-verify flag, and some will. That makes local hooks a fast feedback mechanism rather than an enforcement point. Running the same configuration in CI, with all files rather than only staged ones, is what actually enforces it, and using the identical config file means the two cannot drift. Secret scanning in particular belongs in both places, because the local hook prevents the commit and the CI check catches the one that bypassed it.

Related tools

Frequently Asked Questions

Does pre-commit slow down every commit?

It runs only against staged files by default, so a typical commit touching a few files takes a second or two. The first run after installing is slower because each hook environment is built, and that is cached afterwards.

Can a developer skip the hooks?

Yes, with git commit --no-verify, and some will. That is why the same configuration should also run in CI against all files. Local hooks give fast feedback; CI provides the enforcement.

Why pin the rev field?

Because a hook repository pointing at a branch can change at any time. A formatter update can reformat the whole codebase inside an unrelated commit, and a linter update can fail a build that passed an hour ago. Pin to a tag and use pre-commit autoupdate deliberately.

Which secret scanner should I use?

detect-secrets uses a baseline file so existing findings are acknowledged rather than blocking every commit, which suits an existing repository. gitleaks needs no baseline and is simpler for a new one. Running both is defensible because they detect different patterns.

How do I adopt this on an existing codebase?

Run pre-commit run --all-files once, commit the resulting formatting changes as a single commit, and add that commit to .git-blame-ignore-revs so it does not obscure history. Doing it gradually leaves the repository in a mixed state for months.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Select your languages and the checks you want to generate a pre-commit configuration.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.