Skip to content

Commit 498780e

Browse files
committed
Refine EditorConfig glob spec
The glob spec of EditorConfig works in a non-intuitive way that is different from glob of POSIX-compatible shells. The pattern matching is done in the directory the target file is in instead of the EditorConfig file in, like the '.gitignore' file. Therefore, simply 'foo' matches 'foo' in the root directory and each sub-directory, and '/foo' has to be used to match the file in the root directory only. See: editorconfig/editorconfig#283 (comment) Change-Id: Iea6d25f2ba551db0420ed1fa968f0b355046cabf
1 parent d4d5f11 commit 498780e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.editorconfig

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ indent_style = tab
1010
indent_size = 4
1111
max_line_length = 80
1212

13-
[**/*.[ch]]
13+
[*.[ch]]
1414
indent_style = space
1515
indent_size = 4
1616
max_line_length = 80
1717

18-
[{**/*.py,.ci/*}]
18+
[{*.py,/.ci/*}]
1919
indent_style = space
2020
indent_size = 4
2121

22-
[{scripts/*,.github/workflows/*}]
22+
[{/scripts/*,/.github/workflows/*}]
2323
indent_style = space
2424
indent_size = 2

0 commit comments

Comments
 (0)