PRE-COMMIT CONFIG CHECK · RUNS IN YOUR BROWSER

Why does pre-commit reject my config?

pre-commit stops at the first problem in .pre-commit-config.yaml and prints a chain of ==> At key: lines. Fix it, run again, hit the next one. Paste the file here and see every error at once, each in pre-commit's own words with the line it is on and a plain fix. It also shows what pre-commit accepts without a word: a misspelled hook key it ignores, a duplicate key whose first value is thrown away, and an args item that is really two arguments.

Nothing is uploaded. What you paste is read in this browser and never leaves your device, and the tool makes no network calls of its own.

1. Paste your .pre-commit-config.yaml

Paste a config, then click Check.

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):

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.