From 88ea853c8ece071b55c172802eb96e442a06c326 Mon Sep 17 00:00:00 2001 From: Jo <10510431+j178@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:32:58 +0800 Subject: [PATCH] Add multi-repository configuration example --- docs/configuration.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index fef0731d5..0b2cd0998 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -12,7 +12,24 @@ Both formats are first-class and will be supported long-term. They describe the ```toml [[repos]] repo = "https://github.com/pre-commit/pre-commit-hooks" - hooks = [{ id = "trailing-whitespace" }] + rev = "v6.0.0" + hooks = [ + { id = "trailing-whitespace" }, + { id = "check-toml" }, + ] + + [[repos]] + repo = "local" + hooks = [ + { + id = "cargo-fmt", + name = "cargo fmt", + language = "system", + entry = "cargo fmt --", + types = ["rust"], + pass_filenames = false, + }, + ] ``` === ".pre-commit-config.yaml" @@ -20,8 +37,19 @@ Both formats are first-class and will be supported long-term. They describe the ```yaml repos: - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 hooks: - id: trailing-whitespace + - id: check-toml + + - repo: local + hooks: + - id: cargo-fmt + name: cargo fmt + language: system + entry: cargo fmt -- + types: [rust] + pass_filenames: false ``` ## Global configuration