Comments (7)
plugins should ignore properties with the unset value
Thanks for the explanation. I must say I do not find this decision fortunate, because in this way we make the life more complicated to the plugins trough requiring from them to handle this special value. I think that it would be much less error prone for all parties to require from the property filtering facility (such as editorconfig binary) to simply remove properties having unset
value from the result set.
But OK, I am ready to take this as your decision that you maybe have your reasons for and that you maybe cannot change for backwards compatibility reasons. In any case, this decision should be checked by the tests so that implementations cannot make improper assumptions about the range of the possible values for boolean and integer properties.
I'd propose a PR that will add such tests if you do not mind.
from editorconfig-core-test.
I will look into this. Thanks!
from editorconfig-core-test.
@ppalaga The reason that we do not have specific tests for unset
is that unset
is really treated as a regular value for the core library -- but it is formally defined in the documentation such that plugins should ignore properties with the unset
value. Since it is nothing special for the core library, there is no need to have a special test for that.
from editorconfig-core-test.
The core library actually does very little, and this is for a reason. (a) If there is any new property/new proposed and added to the specification, only plugins need to be updated -- there is no need to update the core. (b) Assuming dynamic linking, if the format itself changes (glob for example), only the core library need to be updated.
The reason for (a) is very important: Linux users often have a stable core library installed, but they can frequently update editors. We also don't want to confuse plugin developers by having cores treating unset differently, and that's why we do not wanna have tests specifically on unset.
from editorconfig-core-test.
@xuhdev all what you say is fine and valid for how core-c and core-py were designed. However, other editorconfig implementations may choose to implement more semantics, by e.g. parsing the "widely accepted" properties as their proper (boolean, integer, ...) types. We do this in ec4j
because we believe it suits our needs well. But at the same time, we want to ensure that our lib accepts all allowed values including unset
. This is the reason we'd very much appreciate to get a set of tests as submitted via #16
from editorconfig-core-test.
I'm not sure whether you understood what I've said. The core libraries treat almost all properties and values as the same: no matter they are defined in the specification or not. This consistent behavior gives plugins a lot of flexibility: they can define their editor specific properties and values, without the need to touch the core libraries. To remove unset
in the core library output is a bit dangerous: What if some editors defined some custom properties and they see unset
as a real thing? Or, in the past, they have treated unset
differently? In addition, by having the core library evolves from not treating unset
differently to treating unset
differently is confusing by itself, not to mention we have multiple core libraries and it's hard to synchronize all of them.
from editorconfig-core-test.
I'm not sure whether you understood what I've said.
I'm not sure whether you understood what I've said :) I am not proposing to change the behavior of core-c and core-py. I am rather proposing to add tests that firm up the current behavior of core-c and core-py so that other libs have a chance to see whether they comply or not. You can clearly see that if you look at the proposed patch: ppalaga@dd28435#diff-50d5f8f9a4351930d5c5cbe948b718b4R89 E.g. having charset=utf-8
above charset=unset
in the file system hierarchy will return charset=unset
- that's exactly what core-c
and core-py
are doing. Such tests are fully in line with what you say and I hope you have nothing against merging the proposed patch.
from editorconfig-core-test.
Related Issues (19)
- "85 - braces_alpha_range1" fails on editorconfig-core-c HOT 5
- Tag the editorconfig spec versions in the editorconfig-core-test repository HOT 3
- Do not pass file names ending with space on Windows as they are illegal there HOT 1
- Assert that [*] matches dot files HOT 1
- Question about parser test octothorpe_in_property & escaped_octothorpe_in_property HOT 25
- Reuse of test code HOT 3
- Tests for escaped special characters in glob expressions HOT 2
- Test globs with braces that are back to back
- Test failures on on Windows: editorconfig returned a nonzero exit code HOT 12
- Break this project into 2 pieces HOT 4
- Add CI
- Incorrect test? HOT 6
- CLI tests with dummy core pass unexpectedly on Windows HOT 7
- No version number in the source code (although git tags exist)
- Ambiguous status of octothorpes and semicolons HOT 12
- Why does the tests have arbitrary `key=value` value pairs HOT 4
- please provide a LICENSE or COPYING file HOT 5
- 10 tests fail on Windows HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editorconfig-core-test.