-
Notifications
You must be signed in to change notification settings - Fork 26
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
Paths with native Windows separator \ don't seem to be matched properly. #16
Comments
|
Can you give an example input and expected output? I suspect that this is intended, as EditorConfig files are supposed to be used cross-platform: We intentionally do not recognize backslashes as path separators, as backslashes can be part of a file name on other systems. |
The examples are in my first post already: An arbitrary native Windows-path as source using OTOH, the docs say the following:
So am I expected to use one section The project I'm using,
This reads like one needs to normalize paths to |
@ams-tschoening Are you a plugin developer using editorconfig-core-java or a user using some editor plugin? |
I'm just so confused by everything you said. Are you using the Eclipse plugin? If so, the plugin should normalize the path before it passes the path to |
He is a user of gradle-eclipseconfig https://github.com/stempler/gradle-eclipseconfig that uses a fork of editorconfig-core-java |
Wouldn't it be easier for your users if you normalize the given path to |
@ams-tschoening As a user, you don't input anything into the core library directly, but input into gradle-eclipseconfig, which in turn passes the path to the core library. In the design of the architecture of EditorConfig, gradle-eclipseconfig should handle the normalization process, and therefore this bug should be reported in gradle-eclipseconfig's issue tracker, which is not governed by us. In other words, I think your concern regarding the expected output makes sense, but I think this is a bug belong to gradle-eclipseconfig. |
I'm working on Windows and tried to use gradle-eclipseconfig to manage charset settings in Eclipse project managed by Gradle. The examples provided by the project didn't work and I think I finally found the problem in the fact that the plugin forwards native paths to
EditorConfig
. WhileEditorConfig
seems to have some recognition of\
in section-globs, it doesn't seem to normalize paths to match in the end. So the simple section[*]
doesn't match Windows paths.Have a look at the following debugging output:
The outputs on STDERR are from
EditorConfig
by setting the following on the shell:These are the regular expressions matched against the paths and as you can see, those are using
/
instead of\
always with my very simple section. In my opinion, before matching the file paths those should be normalized to correspond with whatever is used in the patterns as separator.https://github.com/editorconfig/editorconfig-core-java/blob/master/src/main/java/org/editorconfig/core/EditorConfig.java#L242
The text was updated successfully, but these errors were encountered: