no-recursive-alias
What it does
Section titled “What it does”Reports an alias that is inside the node of its own anchor, which makes the data refer to itself.
Why it matters
Section titled “Why it matters”The data is then a loop with no end. Parsers either refuse the file or build a cyclic structure that breaks the first program that walks it, for example when it is printed or converted to JSON.
To fix, remove the alias or move it out of the anchored node.
Example
Section titled “Example”a: &x b: *xc: &y 1d: *ye: &z...Configuration
Section titled “Configuration”github-actions: lint: rules: no-recursive-alias: error # off, warn, error (default)yaml: lint: rules: no-recursive-alias: error # off, warn, error (default)Enabled by the presets: github-actions/actionlint.
Suppress one line with sudsy-disable-next-line no-recursive-alias in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”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/recursive-alias |
partial | The shared reference rule, enabled by the preset for workflows. |