From 498780e3eef242700c4bbad510717ab80c6c6582 Mon Sep 17 00:00:00 2001 From: Lumynous Date: Fri, 18 Apr 2025 20:51:30 +0800 Subject: [PATCH] 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: https://github.com/editorconfig/editorconfig/issues/283#issuecomment-1921879402 Change-Id: Iea6d25f2ba551db0420ed1fa968f0b355046cabf --- .editorconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9d867c7d9..cf982641e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,15 +10,15 @@ indent_style = tab indent_size = 4 max_line_length = 80 -[**/*.[ch]] +[*.[ch]] indent_style = space indent_size = 4 max_line_length = 80 -[{**/*.py,.ci/*}] +[{*.py,/.ci/*}] indent_style = space indent_size = 4 -[{scripts/*,.github/workflows/*}] +[{/scripts/*,/.github/workflows/*}] indent_style = space indent_size = 2