Skip to content

Commit e67dcc0

Browse files
rogerluanhallettj
andauthored
docs: add explicit documentation about glob matching (hallettj#61)
Co-authored-by: Jesse Hallett <[email protected]>
1 parent 17eaad0 commit e67dcc0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ file names.
7373
The formatter command must read file content from `stdin`, and output formatted
7474
content to `stdout`.
7575

76+
Note that the syntax of the `fnmatch` glob match is a is a bit different from
77+
normal shell globbing. So if you need to match multiple patterns, you should
78+
pass multiple arguments with different patterns, and they will be grouped.
79+
So instead of e.g. `'src/**/*.{js,jsx,ts}'`, you would use:
80+
81+
$ git-format-staged --formatter 'prettier --stdin-filepath "{}"' 'src/*.js' 'src/*.jsx' 'src/*.ts'
82+
7683
Files can be excluded by prefixing a pattern with `!`. For example:
7784

7885
$ git-format-staged --formatter 'prettier --stdin-filepath "{}"' '*.js' '!flow-typed/*'

0 commit comments

Comments
 (0)