yamlfix icon indicating copy to clipboard operation
yamlfix copied to clipboard

Yamlfix squashes comments inside { }

Open vtsarfin-cg opened this issue 1 year ago • 0 comments

Description

It seems to be that yamlfix squashes comments in { }, for example: test.yaml:

---
apiVersion: v1
metadata:
  annotations: 
    {
      a : b,
      # test
        #
      #
  
    }

Steps to reproduce

  1. Run cat test.yaml | yamlfix -
---
apiVersion: v1
metadata:
  annotations: {a: b}

(Comments disappeared.)

Current behavior

See above.

Desired behavior

The output has to be like:

---
apiVersion: v1
metadata:
  annotations: {
    a: b
   # test
   #
   #
}

Environment


 yamlfix: 1.16.0
 Python: 3.11.7
 Platform: macOS-13.6.4-arm64-arm-64bit

Thank you.

vtsarfin-cg avatar Feb 07 '24 13:02 vtsarfin-cg