Skip to content

prek

Install prek

Mise

mise use -g prek

Make prek available as pre-commit for already installed hooks (not sure if this is needed):

ln -s ~/.local/share/mise/installs/prek/latest/prek-x86_64-unknown-linux-gnu/prek ~/bin/download/pre-commit

Configuration

Prek-only:

  • priority
    • Each hook can set an explicit priority (a non-negative integer) that controls when it runs and with which hooks it may execute in parallel.

Install hooks

Needs to be done in every repository. See also FAQ: What does prek install --install-hooks do? and --install-hooks doesn't install all hooks

Install default pre-commit hook:

prek install --install-hooks
``

When you have other hooks than the default `pre-commit` hook configured,
configure them with [default_install_hook_types](https://prek.j178.dev/reference/configuration/#default_install_hook_types)
in the config file or:

```sh
prek install --install-hooks --hook-type commit-msg --hook-type pre-push

Issues / feature requests