google / yamlfmt

An extensible command line tool or library to format yaml files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preserve comments with basic formatter

braydonk opened this issue · comments

I didn't realize that the gopkg.in/yaml.v2 package stripped comments. I'll probably swap libraries for the basic formatter to github.com/goccy/go-yaml which provides a way to preserve comments.

Ah shoot, the go-yaml comment preservation stuff is kind of buggy. Opened goccy/go-yaml#314 but the rate of pull requests in that repo are unfortunately a bit slow. Going to need to solve this another way.