Skip to content
Edit this page View source of this page

Prek

Prek runs the repository's file checks and installs the scripts Git calls at commit time. It provisions the environments for pinned hooks, so the automatically run checks can use versions different from the standalone tools you run through mise.

Which configuration applies

Prek reads prek.toml in your checkout and in the GitHub CI workflow. If you're used to the separate pre-commit program, look here for the settings you would usually find in .pre-commit-config.yaml. The template uses the native builtin repository for checks that ship with Prek.

The suite combines basic file checks for JSON, YAML, TOML, conflict markers, and whitespace with file-specific tools such as Ruff, ty, Tombi, Biome, rumdl, and ShellCheck. It also checks whether the uv lockfile is current and can export requirements.txt when the lockfile is among the files checked.

Run and customize checks

From the repository root, list available hooks, run one hook against a file, or run the complete file suite.

prek list
prek run check-yaml --files .github/workflows/ci.yml
prek run --all-files

Each entry in prek.toml selects a hook by ID. Remote hook repositories also specify a pinned rev. Adjust the hook's arguments or file filters there. For an individual tool's rules, edit its own configuration, such as ruff.toml.

Prek configuration guide ยท Git commit hooks