Skip to content

Compose formatter: YAML anchors broken by formatting #537

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

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions