-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
UCRIssue on Use Case/RecommendationIssue on Use Case/Recommendationout-of-scopeOut of ScopeOut of Scope
Description
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:
- optional header
---
and footer...
- Number of spaces used to indent
- Use of flow-style vs block-style for particular pieces of YAML
- Ordering of keys
- Alias names
- Formatting of text blocks
- String quoting
- Use of escapes and code points in strings
- Serialization of booleans
- etc etc
How to list all controllable features systematically?
- https://yaml.org/spec/1.2.2/#presenting-the-serialization-tree
- https://yaml.org/spec/1.2.2/#323-presentation-stream
Here are the options of some serializers:
- https://metacpan.org/dist/YAML/view/lib/YAML.pod#GLOBAL-OPTIONS
- https://metacpan.org/dist/YAML-LibYAML/view/lib/YAML/XS.pod#CONFIGURATION
- https://metacpan.org/pod/YAML::Syck#FLAGS
- https://metacpan.org/pod/YAML::PP#preserve, https://metacpan.org/pod/YAML::PP#preserved_scalar, https://metacpan.org/pod/YAML::PP#preserved_mapping,-preserved_sequence
- https://metacpan.org/dist/YAML-Dump/view/lib/YAML/Dump.pod#INDENT
- https://pyyaml.org/wiki/PyYAMLDocumentation#cb66-4
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 linter
Finally, this specifically aims to fix presentation, but currently has a somewhat limited set of options
Metadata
Metadata
Assignees
Labels
UCRIssue on Use Case/RecommendationIssue on Use Case/Recommendationout-of-scopeOut of ScopeOut of Scope