-
Notifications
You must be signed in to change notification settings - Fork 8
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
YAML presentation ("cosmetic") controls #42
Comments
@VladimirAlexiev do you think we should define a recommended serialization for YAML-LD, or just to define a linter configuration for this repo (:+1: ) ? I think YAML serialization configuration should be delegated to YAML and implementations, because they will improve over time. An interesting caveat is instead the one related to multiple documents in the same stream, e.g.
|
@ioggstream We should definitely use a consistent style of all our examples, so we need a linter configuration for this repo.
Maybe. However:
|
I think adopting a consistent style for our examples is important, but 👎 on putting anything about a required style in the spec itself. In any case, that should be a YAML concern, not a YAML-LD concern. |
I'm struggling to grok exactly what is proposed here, but I interpret this as a call for supporting the "non round trip-able to JSON features"... which I am in favor of... just we need to start using unique names for both cases. I suggest we just start considering them different media types...
One is JSON-LD round trip-able... the other is not.
|
@OR13 I will vote after the testcases are written :) These days I'm struggling even with very simple issues like extending fragment identification to YAML streams ietf-wg-httpapi/mediatypes#55 since I just discovered that future versions of YAML might consider that docs in a stream are not independent :P |
I agree with @gkellogg and @ioggstream that the spec shouldn't claim any required style. But it can point to a linter configuration as a useful resource. |
Any such mechanism should probably work for JSON as well. But, I'm not aware of any such convention, or how we might signal that, other than through API extensions. |
Discussed at TPAC F2F and resolved to close as out-of-scope. |
YAML has a lot more formatting options, eg to limit display line length of strings. |
As an information architect.
When serializing YAML.
I want control over all YAML presentation ("cosmetic") features.
So that I can obtain a YAML representation that is most readable and usable for my case.
What "cosmetic" features do I mean:
---
and footer...
How to list all controllable features systematically?
Here are the options of some serializers:
Most of these are for Perl, could you please add links to serializers in other languages?
Maybe we should also turn to linters. https://megalinter.github.io/latest/descriptors/yaml/ can use 3 YAML linters:
prettier
: https://prettier.io/docs/en/options.htmlyamllint
: https://yamllint.readthedocs.io/en/stable/rules.html, https://yamllint.readthedocs.io/en/stable/configuration.htmlv8r
: https://github.com/chris48s/v8r#readme. This is a validator against schemas at www.schemastore.org , not a linterFinally, this specifically aims to fix presentation, but currently has a somewhat limited set of options
The text was updated successfully, but these errors were encountered: