You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say we have a section whose glob looks like *.c in a /foo/.editorconfig. AFAICT this section will apply to any file matching the glob /foo/**/*.c, right?
What about a/*.c? Will it match files of the form /foo/**/a/*.c or only /foo/a/*.c?
Is there a way to have a section that applies only to files of the form /foo/*.c (i.e. to C files in /foo but not in subdirectories)?
The spec says very little about these things.
The text was updated successfully, but these errors were encountered:
I agree this is indeed confusing. The spec intends to say that the rules are similar to those used by .gitignore. Therefore, a/*.c doesn't match foo/a/a.c. This is the part of gitignore that we follow:
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.
We should make this clear and add it to the spec and tests.
xuhdev
added a commit
to editorconfig/specification
that referenced
this issue
Jun 18, 2024
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.
Fixeditorconfig/editorconfig#509
Let's say we have a section whose glob looks like
*.c
in a/foo/.editorconfig
. AFAICT this section will apply to any file matching the glob/foo/**/*.c
, right?What about
a/*.c
? Will it match files of the form/foo/**/a/*.c
or only/foo/a/*.c
?Is there a way to have a section that applies only to files of the form
/foo/*.c
(i.e. to C files in/foo
but not in subdirectories)?The spec says very little about these things.
The text was updated successfully, but these errors were encountered: