Add prek support to pre-commit plugin

This commit is contained in:
Markus Hofbauer 2026-01-19 08:43:33 +01:00
commit 1f8ec353df
2 changed files with 25 additions and 13 deletions

View file

@ -1,6 +1,8 @@
# Pre-commit plugin
This plugin adds aliases for common commands of [pre-commit](https://pre-commit.com/).
It also supports [prek](https://github.com/prek/prek) as a drop-in replacement.
If `prek` is available, it will be used; otherwise, `pre-commit` is used as fallback.
To use this plugin, add it to the plugins array in your zshrc file:
@ -10,10 +12,11 @@ plugins=(... pre-commit)
## Aliases
| Alias | Command | Description |
| ------- | -------------------------------------- | ------------------------------------------------------ |
| prc | `pre-commit` | The `pre-commit` command |
| prcau | `pre-commit autoupdate` | Update hooks automatically |
| prcr | `pre-commit run` | The `pre-commit run` command |
| prcra | `pre-commit run --all-files` | Run pre-commit hooks on all files |
| prcrf | `pre-commit run --files` | Run pre-commit hooks on a given list of files |
| Alias | Command | Description |
| ----- | ------------------------------------------------------ | --------------------------------------------- |
| prc | `prek` or `pre-commit` | The pre-commit command |
| prcau | `prek auto-update` or `pre-commit autoupdate` | Update hooks automatically |
| prcr | `prek run` or `pre-commit run` | The pre-commit run command |
| prcra | `prek run --all-files` or `pre-commit run --all-files` | Run pre-commit hooks on all files |
| prcrf | `prek run --files` or `pre-commit run --files` | Run pre-commit hooks on a given list of files |