Skip to content

no-merge-keys

Reports the merge key <<.

The merge key is from YAML 1.1; YAML 1.2 dropped it from the specification. Parsers that follow 1.2 strictly or do not implement it read << as an ordinary key, so the merged values are missing.

To fix, write the merged entries out or let the tool that reads the file expand the anchors.

Reported
base: &base
a: 1
b:
<<: *base
c: 2
d: "<<"
github-actions:
lint:
rules:
no-merge-keys: warn # off (default), warn, error
yaml:
lint:
rules:
no-merge-keys: warn # off (default), warn, error

Enabled by the presets: github-actions/actionlint.

Suppress one line with sudsy-disable-next-line no-merge-keys in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
actionlint syntax-check/merge-key partial The shared reference rule, enabled by the preset for workflows.