"Respectful" YAML patching in Rust

7 points by e_terekhin


colonelpanic

One of YAML’s ergonomic advantages is that a value can have an associated inline note explaining why it’s set the way it is.

This is a misunderstanding of the YAML spec, actually:

Comments are a presentation detail and must not have any effect on the serialization tree or representation graph. In particular, comments are not associated with a particular node. YAML spec v1.2.2 §3.2.3.3

The alignment of a comment in a YAML file with a particular node is purely accidental. That means any tooling that preserves comment placement is a violation of the YAML spec.

One of many reasons why it was an unwise decision to build the entire devops world on this.