-
Notifications
You must be signed in to change notification settings - Fork 859
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
Canonical TOML representation #683
Comments
I can't address canonical representation very clearly, though I've tried. There exist formatters, some described on that other issue, which may get you what you're trying to accomplish. But I don't think that the standard will ever define a canonical representation. Answering your last question: the specification says that key/value pairs within tables are not guaranteed to be in any specific order. So that implies that the order in which keys are defined in the TOML document makes no difference. Although, there are recommendations about keeping dotted keys and subtable definitions together, to avoid confusion. |
Proper formatting (inline VS non-inline, order of keys, etc) depends on specific software that is being configured with given TOML file. It would be nice if TOML Schema would allow to describe "canonical" formatting. |
I don't have anything to add here. We can explore this at a later date, if there's a strong need. For now though, the language specification does not contain any "canonical" representation and, from my perspective, doesn't need to. |
It would be nice if there were a form of "canonical TOML" that implementors can ascribe to when outputting syntax. For example, how keys should be sorted, exactly when inline tables/arrays should be used versus section headers, when strings should be split into multiple lines, how numbers should be separated, etc.
There could be parameters on the canonical representation, and maybe enforcing a single representation isn't always the best, but at least having some sort of TOML style guide might be useful. Deterministic autoformatting is maybe a lofty goal for this kind of format, even though it's substantially easier for something like JSON.
Corollary: does the order of keys matter in TOML? My best guess is no, but that's another consideration.
The text was updated successfully, but these errors were encountered: