chainguard-dev / yam

A sweet little formatter for YAML
Apache License 2.0
20 stars 10 forks source link

formatting breaks yaml anchors #46

Closed shyim closed 6 months ago

shyim commented 6 months ago

Running yam on following YAML

public: &public_bucket
    type: "amazon-s3"
    url: "%env(CDN_URL)%"
    visibility: "public"
    config:
        bucket: "%env(AWS_PUBLIC_FILESYSTEM_BUCKET)%"
        region: "%env(AWS_REGION)%"
        endpoint: "%env(AWS_ENDPOINT_URL)%"
        use_path_style_endpoint: true

theme: *public_bucket
asset: *public_bucket

generates invalid yaml to:

public:
  type: "amazon-s3"
  url: "%env(CDN_URL)%"
  visibility: "public"
  config:
    bucket: "%env(AWS_PUBLIC_FILESYSTEM_BUCKET)%"
    region: "%env(AWS_REGION)%"
    endpoint: "%env(AWS_ENDPOINT_URL)%"
    use_path_style_endpoint: true
theme:
*public_bucket
asset:
*public_bucket
shyim commented 6 months ago

https://github.com/chainguard-dev/yam/issues/43