This addresses a few cases where unexpected formatting would happen, either because of the upstream library (https://github.com/go-yaml/yaml) or because of yam itself.
Comments being lost
Comments in lists resulting in malformation
This also makes a change such that, before formatting is applied, all files undergo two "cleaning steps" that are common reasons for surprise structural encodings from https://github.com/go-yaml/yaml.
All lines have any trailing spaces trimmed
Ensures all files end with a final newline character
This addresses a few cases where unexpected formatting would happen, either because of the upstream library (https://github.com/go-yaml/yaml) or because of yam itself.
This also makes a change such that, before formatting is applied, all files undergo two "cleaning steps" that are common reasons for surprise structural encodings from https://github.com/go-yaml/yaml.