From 90b274ef8e11e78262372333a5eea6da5f2df7f7 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sun, 15 Sep 2024 18:28:50 -0700 Subject: [PATCH 1/2] Clarify the effects of path separator (#49) * Clarify the effects of path separator This is consistent with the rules from `.gitignore`: > If there is a separator at the beginning or middle (or both) of the > pattern, then the pattern is relative to the directory level of the > particular .gitignore file itself. Otherwise the pattern may also match > at any level below the .gitignore level. Since we intend to be consistent with `.gitignore`, this part of the spec has been unclear. Fix editorconfig/editorconfig#509 * Update index.rst Co-authored-by: Chris White --------- Co-authored-by: Chris White --- index.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.rst b/index.rst index 74f1120..749bdab 100644 --- a/index.rst +++ b/index.rst @@ -160,6 +160,13 @@ special characters for wildcard matching: - any integer numbers between ``num1`` and ``num2``, where ``num1`` and ``num2`` can be either positive or negative +If the glob contains a path separator (a ``/`` not inside square brackets), then the glob is relative +to the directory level of the particular `.editorconfig` file itself. +Otherwise the pattern may also match at any level below the `.editorconfig` +level. For example, ``*.c`` matches any file that ends with ``.c`` in the +directory of ``.editorconfig``, but ``subdir/*.c`` only matches files that end +with ``.c`` in the ``subdir`` directory in the directory of ``.editorconfig``. + The backslash character (``\\``) can be used to escape a character so it is not interpreted as a special character. From 0a05b74497331997cfafd53147ca17d5f9a19bd8 Mon Sep 17 00:00:00 2001 From: Chris White Date: Sun, 15 Sep 2024 21:45:10 -0400 Subject: [PATCH 2/2] .editorconfig files MUST be utf-8, not just SHOULD. (#53) Fixes editorconfig/editorconfig#497 Co-authored-by: Hong Xu --- conf.py | 4 ++-- index.rst | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/conf.py b/conf.py index 67c77b7..775f278 100644 --- a/conf.py +++ b/conf.py @@ -21,8 +21,8 @@ copyright = '2019--2024, EditorConfig Team' author = 'EditorConfig Team' -version = '0.16.0' -release = '0.16.0' +version = '0.17.0' +release = '0.17.0' # -- General configuration --------------------------------------------------- diff --git a/index.rst b/index.rst index 749bdab..8810ac5 100644 --- a/index.rst +++ b/index.rst @@ -73,6 +73,8 @@ EditorConfig organization. File Format =========== +.. versionchanged:: 0.17.0 + EditorConfig files are in an INI-like file format. In an EditorConfig file, all beginning whitespace on each line is considered irrelevant. Each line must be one of the following: @@ -94,7 +96,7 @@ irrelevant. Each line must be one of the following: Any line that is not one of the above is invalid. -EditorConfig files should be UTF-8 encoded, with LF or CRLF line separators. +EditorConfig files must be UTF-8 encoded, with LF or CRLF line separators. No inline comments ------------------