Skip to content

Prek

Prek is a git hook manager for pre-commit checks.

With prek a list of pre-commit checks can be defined that will be executed on the code before it is committed. If the checks fail, the commit is aborted. This ensures that the code being committed follows certain standards, but many programmers also find this limiting.

The prek related settings are defined in the .pre-commit-config.yaml file.

Info

To use prek, it has to be installed in the virtual environment and also added to the git hooks by running prek install.

Call prek by making a git commit or by running:

uv run prek run --all-files

Or (alternatively) use just:

just prek

I used to use pre-commit before, but switched to prek as it seems to be more actively maintained.