Made this patch release because I don't have any upcoming work planned on yamlfmt
at the moment and wanted to get this bugfix released.
Bug Fixes
yaml files with just comments had their contents erased.
If a yaml file had just comments, previously yamlfmt would erase the contents. This was an oversight on how yaml.v3
parses a file like this. Comment parsing works such that any comments found are attached as head, line, or foot comments to a given node. Since a yaml file with just comments has no nodes, the comment wouldn't be anywhere in the parse tree because the parse tree would be empty. Empty parse tree = yamlfmt produces an empty document. This is now properly treated as an edge case and will retain the contents as originally passed in if the file is just comments.