-
Notifications
You must be signed in to change notification settings - Fork 23
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
Why does the tests have arbitrary key=value
value pairs
#50
Comments
Yes, all cores need to handle all keys, even those not defined. There are many more custom keys in the wild than defined keys, as far as I can tell from the discussions I've seen! However, I note this is not expressly called out in https://spec.editorconfig.org/#supported-pairs. I will open a PR clarifying that. Edit as for why --- I think just convenience :) . In some cases, we use different keys or values to make sure that the core is reading from the correct section of a |
I took a quick look at https://github.com/mstruebing/editorconfig-core-rust/blob/main/src/main.rs#L45. Cores should not have any specific knowledge of which keys or values are relevant. That knowledge lives in the plugin, which maps key/value pairs to a particular editor's settings. Therefore, your core does not need The core is just a text processor: it reads text files, looks for glob matches, and pulls out key-value pairs. Its ultimate output is a set of key-value pairs that relate to a specific file, and that set is what the core tests are checking for. Here's an example on my system:
The core looked through the I hope this helps! I am going to close this issue, but feel free to ask further questions if you need assistance! (For what it's worth, I implemented the Vimscript core by translating the Python core :) . ) |
Here's an example of a key not in the spec: dotnet/roslyn#33012 is using the custom property |
As posted in editorconfig/specification#37 (comment):
|
I'm currently implementing a rust version of the core and when running and digging into the test suite I see that
mostly
key=value
is used.Whereas editorconfig specification specifies which key-value pairs are allowed.
Is there some reason for this?
Why don't we use options from the specification? That means every core needs to handle key-value pairs (
key=value
) which are not really defined in the spec.The text was updated successfully, but these errors were encountered: