editorconfig / editorconfig-emacs

EditorConfig plugin for Emacs
https://editorconfig.org
GNU General Public License v3.0
748 stars 107 forks source link

respscts `[Makefile]` but not `[{Makefile}]` #315

Closed mmahmoudian closed 1 year ago

mmahmoudian commented 1 year ago

First and foremost, thanks for maintaining this package.

I was hitting my head against the wall to debug a Makefile that ultimately I realized one of the lines has space indentation instead of tab. The following is my

root = true

[*]
indent_style = space
indent_size  = 4
charset = utf-8
insert_final_newline = true

[{Makefile}]
indent_style = tab
indent_size  = 4
insert_final_newline = true

The following is the output of editorconfig-display-current-properties:

# EditorConfig for /home/mehrad/<<redacted>>/Makefile
indent_style = space
indent_size = 4
charset = utf-8
insert_final_newline = true
tab_width = 4

But when I change [{Makefile}] to [Makefile] the editorconfig-display-current-properties shows:

# EditorConfig for /home/mehrad/<<redacted>>/Makefile
indent_style = tab
indent_size = 4
charset = utf-8
insert_final_newline = true
tab_width = 4

I checked the specification of the EditorConfig and I cannot find any restrictions to not to treat [{filename}] as correct syntax.

xuhdev commented 1 year ago

[{Makefile}] only matches {Makefile} literally. The spec doesn't make it clear, but the test has already enforced it:

I'll clarify in the spec.