1. Paste your .pre-commit-config.yaml
Paste a config, then click Check.
Findings
| Line | Level | What is wrong and how to fix it |
|---|
What pre-commit itself prints
pre-commit stops at its first error. This is that error, in its format:
How close is this to pre-commit?
The rules are pre-commit 4.7.0's own schema (its clientlib.py and the cfgv validators), checked in the same order with the same messages. Two pieces pre-commit gets from Python are rebuilt here: a YAML reader that types values the way PyYAML does, and a checker for Python's regular-expression syntax, which differs from the browser's.
Each piece was compared with the real thing (counts from the run of 2026-11-22, scripts in the repository):
- Whole configs: the
.pre-commit-config.yamlof 69 public projects, plus 5,175 single-edit variants of them. Accept or reject, the first error with its full context chain, and every warning pre-commit logs agreed on all 5,244 files. - YAML: the same 69 files plus 45 hand-written edge cases loaded identically to PyYAML 6.0.4.
- Regex: 199,999 of 200,000 generated patterns got the same verdict as CPython 3.11's
re.compile. The one miss used\N{name}, whose character table is not bundled.
The variants were generated from a list of mistakes written for this tool, so they test the traps it was built for, not every possible config. Findings marked "beyond pre-commit" are this tool's opinion, not pre-commit's behaviour.
Prefer a CLI, or want this in your own CI?
Same code, zero dependencies:
node cli.mjs # ./.pre-commit-config.yaml
node cli.mjs path/to/config.yaml # a specific file
node cli.mjs --format json # machine-readable
node cli.mjs --strict # exit 1 on warnings too
node cli.mjs --pre-commit-version 3.8.0 # judge minimum_pre_commit_version against your version
Get cli.mjs and the four modules beside it (check.mjs, yaml11.mjs, pyregex.mjs, tables.mjs) from the repository. Node 18 or newer, nothing to install. If you already have pre-commit installed, pre-commit validate-config gives you its first error; this gives you all of them and the silent ones.
Common questions
Why does pre-commit say "Expected string got int"?
pre-commit reads its config with PyYAML, which follows YAML 1.1. An unquoted 100 in args: [--line-length, 100] is an integer, an unquoted 6.0 in rev: is a float, and 2024-01-01 is a date. args, rev and language_version must be strings, so quote the value: '100', '6.0'.
Can I use a glob like *.py in files: or exclude:?
No. files and exclude are Python regular expressions. Unquoted, *.py is not even valid YAML (a leading * starts an alias); quoted, it is not a valid regex (nothing to repeat). Write \.py$ for files ending in .py and ^docs/ for a folder.
Does pre-commit warn about a misspelled hook key?
No. pre-commit warns about unknown keys at the top level and on a repo, but an unknown key inside a hook is ignored without a word. This tool lists them and suggests the key you probably meant.
What does the mutable reference warning mean?
A rev: like main or stable names a branch or moving tag. pre-commit installs it once and never updates it, so different machines can run different code. Pin a release tag or a commit SHA; pre-commit autoupdate --freeze writes SHAs.
Is my config uploaded?
No. The check runs in this browser and makes no network calls. It reads only the text you paste; it does not install hooks or contact GitHub.