chainguard-dev / yam

A sweet little formatter for YAML
Apache License 2.0
19 stars 9 forks source link

formatting breaks yaml anchors #46

Closed shyim closed 4 months ago

shyim commented 4 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 4 months ago

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