Comments (10)
Now to answer the OP, I think we should stick with what he said:
Any property other than root MUST be located under a section to take effect. They are not otherwise recognized.
And don't do any of the default [*]
stuff.
from specification.
I agree with updating the spec to clarify the current behaviour. I agree that implicit [*]
would be more ergonomic, but I personally think we would need to more clearly define our versioning scheme before making such a significant change! Edit Specifically, I think we would need a way for cores or plugins to provide a meaningful error message when encountering an unsupported feature. E.g., perhaps a root version
property. However, that would be a separate issue.
from specification.
OK, sounds good to me.
from specification.
To be clear, the EditorConfig INI parser allows you to specify any/all custom properties that you want. Some people actually use this for their own custom implementations outside of EditorConfig. root=true
is the only root property that EditorConfig does anything with, but I don't know if invalid is the right word to use if a property that is not root=true
is at the root level.
That said, I also very much agree that we need more clarification and less ambiguity about these things and I'm actively working on that very goal during my international travels. I hope at least we can make one step forward on this.
from specification.
It doesn't sound right to me to put any other settings on root. Do we have statistics on what we do right now?
from specification.
@xuhdev for the purposes of EditorConfig, you're right. That's all we would ever need or support. But for anyone outside of EditorConfig who is perhps using the config inheritance feature of EditorConfig, there's nothing stopping them from defining custom properties at the root level.
This is another reason why I think it's important to distinguish between:
- The actual INI parsing and only the INI parsing. No rule restrictions at root or within sections.
- Supporting EditorConfig-specific rules.
- The inheritance feature.
These are all very different things and I can see non-EditorConfig implementations that rely upon 1 & 3, but not 2.
from specification.
I think whether an assignment not under any section is a matter of syntactic definition. If we allow any anything other than root
outside any section, we would be essentially repeating the functionality of [*]
. I don't see any reason to duplicate this functionality twice. But I agree we should make this point clear.
Currently, as far as I see, the C core does not output anything not in any sections.
from specification.
You're right. It doesn't look like the js core does either.
root = true
foo = bar
[*]
qux = corge
The output was just qux=corge
.
I think the INI parser should definitely record those properties at root though. Whether we do anything with them is another story.
from specification.
I'm not sure whether there's any benefit to break with the existing behavior and output properties at root. I'm personally leaning toward clarifying this existing behavior rather than altering it.
from specification.
To be clear, I'm not suggesting we output, change or break anything with respect to the existing EditorConfig implementation. I'm saying that the INI parsing aspect of EditorConfig can be decoupled into a separate parser that knows nothing about EditorConfig's rules and especially nothing about root=true
or any of the merging strategy.
As it doesn't know anything about root=true
, it doesn't make sense to impose this artificial limitation of only having one property in the default/root section. Once an EditorConfig core gets its hands on this AST provided by the parser, then it can ignore the unsupported rules or even throw validation errors at that point, if we decide to go that route.
The point is, we can keep the INI parsing as agnostic to implementation as possible and put EditorConfig-specific "business logic" into the cores instead of the INI parser itself.
from specification.
Related Issues (20)
- How is this going to work? HOT 11
- Versioning with SemVer HOT 2
- Introduce AST + validation errors HOT 21
- Clarification on insert_final_newline behavior for empty files HOT 3
- Clarify the behavior of leading slash in section title HOT 2
- Clarify behavior of trim_trailing_whitespace HOT 6
- Clarify behavior of ; and # within values HOT 14
- max_line_length is not specified HOT 15
- Readthedocs link mentioned in README.md not available HOT 4
- [Title]
- Tell IDE to ignore files HOT 3
- Odd grammatical syntax at supported-properties/root HOT 1
- Use editorconfig.org subdomain HOT 3
- How to have a multiline value HOT 2
- Clarify 'key containing whitespace' case HOT 8
- Table of Content HOT 6
- version tags? HOT 1
- Clarify glob matching HOT 7
- Enhancement: Light comment style preference HOT 2
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 specification.