Skip to content

Commit

Permalink
Clarify the effects of path separator (#49)
Browse files Browse the repository at this point in the history
* Clarify the effects of path separator

This is consistent with the rules from `.gitignore`: <https://git-scm.com/docs/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 <cxwembedded@gmail.com>

---------

Co-authored-by: Chris White <cxwembedded@gmail.com>
  • Loading branch information
xuhdev and cxw42 authored Sep 16, 2024
1 parent 755ddfd commit 90b274e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 90b274e

Please sign in to comment.