goss icon indicating copy to clipboard operation
goss copied to clipboard

`goss add` reformats the file, removes comments

Open thrix opened this issue 3 years ago • 1 comments

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?

thrix avatar Mar 24 '22 05:03 thrix

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 avatar Sep 09 '22 01:09 aelsabbahy

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

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

aelsabbahy avatar Feb 18 '23 19:02 aelsabbahy