PureYAML/Sources/Emitting
Mihaela Mihaljevic ec3642bacc feat(emitting): add indentWidth and sortKeys emitter options
Closes two of the four emitter gaps a feature-parity audit against Yams
found (PureYAMLYamsComparison's FEATURE-PARITY.md): no configurable
indentation and no sorted-key output.

indentWidth replaces every hardcoded indent + 2 in Dumper.swift/
Dumper.Mapping.swift, verified with round-trip tests since indentation is
purely a rendering choice and must never change what a document means.

sortKeys sorts a mapping's pairs by their string key in both block and flow
style, but only when every key in that mapping is a plain string; a mapping
with any complex (mapping/sequence) key stays in insertion order, since
there is no well-defined ordering across mixed key kinds. Off by default,
since insertion order is what makes a duplicate-key-preserving Mapping
round-trip meaningfully in the first place.

width-based line wrapping and canonical mode are each a correctness surface
of their own and are deliberately left for later, not folded into this.
2026-07-10 17:49:44 +02:00
..
Dumper.Mapping.swift feat(emitting): add indentWidth and sortKeys emitter options 2026-07-10 17:49:44 +02:00
Dumper.Stream.swift feat(emitting): dump YAML streams 2026-06-05 17:14:41 +02:00
Dumper.swift feat(emitting): add indentWidth and sortKeys emitter options 2026-07-10 17:49:44 +02:00
Emitting.CollectionStyle.swift feat(emitting): add flow collection output 2026-06-05 11:09:58 +02:00
Emitting.ScalarStyle.swift feat(emitting): add literal block scalar output 2026-06-05 11:06:19 +02:00
Options.swift feat(emitting): add indentWidth and sortKeys emitter options 2026-07-10 17:49:44 +02:00