New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple entries in section names #71
Comments
I have only two objections:
In general I really like this idea. I find that this is a common use case:
|
I do think that it is great to have multiple patterns in a section name. But this way will break the compatibility (@treyhunner This won't break the plugin compatibility, but break the previous
What do you think? |
@xuhdev this will break compatibility for previous core libraries which means new @myss Do you think we should add support for this feature in the next core library release so the support will be there in the future when we encourage the use of this option? The format @xuhdev mentioned is interesting, but I think I prefer the |
@treyhunner If no one is using |
Can't you just use brace expansion? [*.{html,js,css}]
indent_style = space
indent_size = 2 |
@sindresorhus I have never seen that notation before. What languages/technologies use that convention? |
I only use it in bash and glob Node.js module, but I'm sure there are more. |
I just committed changes to the Python core to add support for curly brace expansion (editorconfig/editorconfig-core-py@e4807b1 and editorconfig/editorconfig-core-py@bef6cc5). It should work similarly to node's minimatch module currently (though not quite the same). Now we need some tests written and the C core library still needs to be changed. |
Nice to hear this. I'll make some changes when I have some free time. |
This feature is now live in the EditorConfig Python core version 0.11.0 which is on PyPI. The C core is finished also but the various EditorConfig plugins still need to be updated to use the new core library versions. |
No plugin code needs to be updated. They just need to be compiled against the new core library. So this could be done very soon. |
You're correct. That's what I meant to state. I'm closing this issue as resolved. |
@sindresorhus Can we add the example you gave to EditorConfig's doc example?
|
PR welcome for improvements to the docs: https://github.com/editorconfig/editorconfig.github.com |
Great @sindresorhus, will do! |
Currently we can have only one pattern in section names. But sometimes, to avoid repetition, it would be more useful to allow multiple patterns. The patterns could be separated by
|
, which is a character not allowed in file names.Example:
The text was updated successfully, but these errors were encountered: