Skip to content

Commit

Permalink
Document interaction of root with glob
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiecobbett committed Feb 3, 2025
1 parent 5fde6d6 commit 81b313b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/mdbook/configuration/glob.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions docs/mdbook/configuration/root.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 81b313b

Please sign in to comment.