Skip to content

Compose formatter: YAML anchors broken by formatting #128

@justinbowes

Description

@justinbowes

YAML fragments are supported in docker-compose.yaml.

The following minimal example has its &anchor broken when formatted:

version: "3.5"

x-anchor: &anchor
  FOO: bar

services:
  example:
    image: alpine

Formatting makes the following change:

version: "3.5"

x-anchor: 
  &anchor
  FOO: bar

services:
  example:
    image: alpine

I would expect the compose formatter to not insert newlines that break supported syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions