add fmt command to format YAML files
now that yaml.v3 is out and supports preserving comments on yaml nodes, it would be nice to have ytt fmt -R -f . command that would format yaml files in place.
not planning to rely yaml.v3...
first pass: https://github.com/k14s/ytt/commit/d7c7e0afa683d54d48f1359fb0dfdce32fbe26eb
The Hardest Program I've Ever Written – How a code formatter works (2015) (stuffwithstuff.com) has some good discussion about code formatting.
In place formatting would be nice :)
In place would actually be very nice ;)
This is only partially done: comments are still not preserved.
We're doing some exploration with yaml.v3 (even if only for rendering): #638