-
Notifications
You must be signed in to change notification settings - Fork 22
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
Ambiguous status of octothorpes and semicolons #46
Comments
It seems to me that it is necessary to clarify that |
Below are some examples. EditorConfig for Visual Studio Code v0.16.4 ignores section names with unescaped If you use Sublime Text plugin for EditorConfig v1.0.0, a single unescaped All these plugins allow an inline comment after a key-value pair. In this case, the Sublime Text plugin requires a space before |
The spec was written to align with the existing implementation and tests. See also these tests for the Rust implementation. I never really liked this rule, but it would be a breaking change to remove this "feature." cc @florianb |
Also, if the intent is to remove this behavior, deleting the tests is not enough. We should change the tests to explicitly not support this. |
Thanks for the cc – in my opinion this is a glitch in the implementation of INI-parsers, caused by a missing INI specification (something one-ini) aims to solve.
I think the solution in this case should be to urge the editorconfig plugin to configure it's INI parser the way to handle this case correctly.
I remember that the Python-parser had tons of options to configure.
…________________________________
Von: Jed Mao ***@***.***>
Gesendet: Freitag, 16. Juli 2021 04:53
An: editorconfig/editorconfig-core-test
Cc: Florian Neumann; Mention
Betreff: Re: [editorconfig/editorconfig-core-test] Ambiguous status of octothorpes and semicolons (#46)
Also, if the intent is to remove this behavior, deleting the tests is not enough. We should change the tests to explicitly not support this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#46 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHQDU74ONA73MBMWCUHDPTTX6NLBANCNFSM5ANL5YEQ>.
|
@jedmao I recall we had some discussions about the handling of comments. Did we already settle a decision or were the Rust tests a first step to adopt EditorConfig specs?
I am currently not at my workplace so I can't access all repos here – but usually we tried to adopt the default behavior of the most common Ini-parsers.
I personally try to avoid unusual/unexpected escape patterns.
|
It is clear that developers implement non-standard inline comments at their own risk. But...
While the specification simply doesn’t recommend |
@edukisto thank you very much for pointing that out! English is not my mother tongue – i guess i am not the best person to answer this right now and i always had my struggles with "neither" constructs. For a more streamline EditorConfig future i would love to see inline comment symbols being entirely ignored (simply being treated as part of the name, key or value). I don't know how others look at this issue - but i guess we need to clarify the specification at that point. I would also like to think about moving away from inline-comment handling at all. |
I agree with @florianb that it is also an option to completely ignore inline comment symbols (simply being treated as part of the value (not key or name)). This is in line with what our tests currently enforce and is also a reasonable choice. I agree we should clarify on this -- shall we start a poll on this? |
@florianb, @xuhdev, the main problem is that the specification implicitly classifies Moreover, according to these tests, there are three special characters: I’ve tested C, JavaScript, and Python cores and here are some suggestions below.
|
@edukisto – thank you very much for your exhausting analysis. Indeed - the current ecosystem of Ini-parsers is very fragmented in multiple ways. My intention at this point would be to first simplify the specification and fix any ambiguities. This would also issue the demand to fix all dependent implementations in the second step. This is no easy task and i guess it will take time. The one-ini project already aims to get rid of these underlying parser based ambiguities. And i guess i should (besides of the fact that i need to spend time on one-ini after i return from holiday) also propose a draft for a process-guidance for implementors, also providing goals for text mangling tools, fixers and linters. Your feedback came to the right time - we finally need to fix the issues with the ini format. |
On the one hand, an inline sequence with a leading
#
and;
“shall neither be parsed as a comment nor as part of the section name, pair (defined below) key or value in which it was inserted” (from the spec).On the other hand, this and this normative tests allow
#
and;
inside values.Could you please clarify which of the statements is correct?
The text was updated successfully, but these errors were encountered: