editorconfig / editorconfig-core-js

EditorConfig Core library and command line utility written in JavaScript
http://editorconfig.org
MIT License
272 stars 48 forks source link

Match of multiple files with brace expansion notation does not work with one extension #92

Closed eldf7 closed 2 years ago

eldf7 commented 3 years ago

The following config will match a .js file

[*.{js,py}]
indent_style = space
indent_size = 2

whereas the following will not:

[*.{js}]
indent_style = space
indent_size = 2

Expected behavior is [*.{js}] would match a .js file which is the behavior in other editorconfig core libraries.

hildjj commented 2 years ago

This is by design, in order to be compatible with bash. See https://github.com/juliangruber/brace-expansion/issues/56#issuecomment-918963909.

(we use minimatch, which uses brace-expansion for this piece of functionality)

I think I agree with the logic, so I'm going to close this. But feel free to comment more and we'll reopen it if we come up with a good argument.