From 8ef9abc9621321c41e89c578bc6f12176696f36c Mon Sep 17 00:00:00 2001 From: Markus Hofbauer Date: Wed, 23 Nov 2022 10:23:11 +0100 Subject: [PATCH] feat(pre-commit) add aliases (#10707) --- plugins/pre-commit/README.md | 19 +++++++++++++++++++ plugins/pre-commit/pre-commit.plugin.zsh | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 plugins/pre-commit/README.md create mode 100644 plugins/pre-commit/pre-commit.plugin.zsh diff --git a/plugins/pre-commit/README.md b/plugins/pre-commit/README.md new file mode 100644 index 000000000..e6d80d369 --- /dev/null +++ b/plugins/pre-commit/README.md @@ -0,0 +1,19 @@ +# Pre-commit plugin + +This plugin adds aliases for common commands of [pre-commit](https://pre-commit.com/). + +To use this plugin, add it to the plugins array in your zshrc file: + +```zsh +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 | diff --git a/plugins/pre-commit/pre-commit.plugin.zsh b/plugins/pre-commit/pre-commit.plugin.zsh new file mode 100644 index 000000000..c3d0c6290 --- /dev/null +++ b/plugins/pre-commit/pre-commit.plugin.zsh @@ -0,0 +1,8 @@ +# Aliases for pre-commit +alias prc='pre-commit' + +alias prcau='pre-commit autoupdate' + +alias prcr='pre-commit run' +alias prcra='pre-commit run --all-files' +alias prcrf='pre-commit run --files'