goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.53k stars 470 forks source link

`goss add` reformats the file, removes comments #749

Closed thrix closed 1 year ago

thrix commented 2 years ago

I guess this is just because the goss.yaml is loaded and then rewritten with the new content. This also means we lose comments in our yaml files or the formatting is changed.

I wonder, is this somehow easily solvable? Would it make sense to provide formatting option to goss to be able to fine tune the yaml and try to fix the removal of the comments?

aelsabbahy commented 1 year ago

I wonder, is this somehow easily solvable?

I don't think it's easily solvable, I could be wrong. Do you know of any tools that do something similar with YAML?

That said, there is title and meta for that purpose today https://github.com/aelsabbahy/goss#manually-editing-goss-files

Does that satisfy your use-case?

aelsabbahy commented 1 year ago

Closing this, since I don't think it's easily done.

Feels free to reopen if title / meta don't meet your needs.