diff --git a/knowledge base/pre-commit.md b/knowledge base/pre-commit.md index 3eba634..c992496 100644 --- a/knowledge base/pre-commit.md +++ b/knowledge base/pre-commit.md @@ -3,6 +3,7 @@ ## Table of contents 1. [TL;DR](#tldr) +1. [Local hooks](#local-hooks) 1. [Troubleshooting](#troubleshooting) 1. [Some files are skipped during a run](#some-files-are-skipped-during-a-run) 1. [Further readings](#further-readings) @@ -24,13 +25,32 @@ pre-commit install # It is *not* always the latest *stable* release. pre-commit autoupdate -# Skip check on commit. +# Skip checks on commit. SKIP="check_id" git commit -m "foo" git commit --no-verify -m "foo" ``` [Config file example]. +## Local hooks + +```yml +# .pre-commit-config.yaml +repos: + - repo: local + hooks: + - id: do-something-with-make-once + name: Do something with GNU Make once + language: system + entry: make do-something + pass_filenames: false + require_serial: true + - id: call-script-passing-files + name: Call a local script passing files as arguments + language: script + entry: path/to/script.sh +``` + ## Troubleshooting ### Some files are skipped during a run