Skip to content
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

Equals sign '=' missing after property name 'ij_http' #122

Open
rosingrind opened this issue Mar 21, 2023 · 6 comments
Open

Equals sign '=' missing after property name 'ij_http' #122

rosingrind opened this issue Mar 21, 2023 · 6 comments

Comments

@rosingrind
Copy link

Summary

I'm using ktlint which utilizes ec4j, default IDEA settings exported as .editorconfig contains next lines:

[{*.http,*.rest}]
ij_http request_call_parameters_wrap = normal

Parsing .editorconfig which contains ij_http request_call_parameters_wrap = normal causes exception:

Caused by: org.ec4j.core.parser.ParseException: path:/Users/*/app/.editorconfig:14:9: Equals sign '=' missing after property name 'ij_http'
        at org.ec4j.core.parser.ErrorHandler$3.error(ErrorHandler.java:54)
        at org.ec4j.core.parser.EditorConfigParser.readProperty(EditorConfigParser.java:348)
        at org.ec4j.core.parser.EditorConfigParser.readLine(EditorConfigParser.java:187)
        at org.ec4j.core.parser.EditorConfigParser.readLines(EditorConfigParser.java:152)
        at org.ec4j.core.parser.EditorConfigParser.parse(EditorConfigParser.java:131)
        at org.ec4j.core.EditorConfigLoader.load(EditorConfigLoader.java:78)
        at com.pinterest.ktlint.rule.engine.internal.ThreadSafeEditorConfigCache$CacheValue.<init>(ThreadSafeEditorConfigCache.kt:95)

Reproduction

You can reproduce this issue by using .editorconfig which contains ij_http request_call_parameters_wrap = normal (either export default IDEA settings or create one containing). This issue was originally created at pinterest/ktlint#1866, ec4j version is 0.3.0 (from libs.versions.toml)

@angelozerr
Copy link
Collaborator

I have not found some specification in .editrorconfig with property name which have a space (there is a space after ij_http).

What means this space?

@angelozerr
Copy link
Collaborator

Should be not ?

ij_http_request_call_parameters_wrap = normal

@rosingrind
Copy link
Author

Should be not ?

ij_http_request_call_parameters_wrap = normal

I think not. Try searching GitHub for this line, it's used in many exported configs: https://github.com/search?q=ij_http+request_call_parameters_wrap&type=code

@angelozerr
Copy link
Collaborator

By reading samples from githubI have the impression it is the only property xhich have a space in the property name.

Is it a bug from IJ? I suggest that you ask to IJ.

I have not found some docs about this property.

@ppalaga
Copy link
Contributor

ppalaga commented Mar 22, 2023

What an interesting corner case! Thanks for reporting this @rosingrind!

The spec does not prohibit whitespace in keys:

Key: the part before the first = (trimmed of whitespace).

However, I'd vote for not fixing this before the broader EditorConfig community explicitly accepts this as legal. Would you mind filling a clarification issue at https://github.com/editorconfig/specification/issues ?

It would be great to have a test for this in https://github.com/editorconfig/editorconfig-core-test so that other parsers have a chance to adapt too.

@rosingrind
Copy link
Author

@angelozerr @ppalaga just a status update: it seems that the spec is updated in editorconfig/specification#43 and tests are on their way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants