From 81b313b574c887e960f185c85e76b1abfcfea7b8 Mon Sep 17 00:00:00 2001 From: jamiecobbett Date: Mon, 3 Feb 2025 08:43:06 +0000 Subject: [PATCH] Document interaction of root with glob --- docs/mdbook/configuration/glob.md | 4 ++++ docs/mdbook/configuration/root.md | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/mdbook/configuration/glob.md b/docs/mdbook/configuration/glob.md index fce1a412..f278645f 100644 --- a/docs/mdbook/configuration/glob.md +++ b/docs/mdbook/configuration/glob.md @@ -31,6 +31,10 @@ pre-commit: For patterns that you can use see [this](https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm) reference. We use [glob](https://github.com/gobwas/glob) library. +***When using `root:`*** + +Globs are still calculated from the actual root of the git repo, `root` is ignored. + ***Behaviour of `**`*** Note that the behaviour of `**` is different from typical glob implementations, like `ls` or tools like `lint-staged` in that a double-asterisk matches 1+ directories deep, not zero or more directories. diff --git a/docs/mdbook/configuration/root.md b/docs/mdbook/configuration/root.md index b8221910..78c1188d 100644 --- a/docs/mdbook/configuration/root.md +++ b/docs/mdbook/configuration/root.md @@ -33,3 +33,9 @@ pre-commit: glob: "*.{js,ts}" run: yarn eslint --fix {staged_files} && git add {staged_files} ``` + +**Notes** + +***When using `root:`*** + +Globs are still calculated from the actual root of the git repo, `root` is ignored.