no-undefined-alias
What it does
Section titled “What it does”Reports an alias that names an anchor not defined earlier in the same document, on the alias.
Why it matters
Section titled “Why it matters”YAML requires the anchor to come first, in the same document, so the file is invalid and a parser stops with an error.
To fix, define the anchor above the alias, or fix the name.
Example
Section titled “Example”a: &x 1---b: *xConfiguration
Section titled “Configuration”github-actions: lint: rules: no-undefined-alias: error # off, warn, error (default)yaml: lint: rules: no-undefined-alias: error # off, warn, error (default)Enabled by the presets: yaml/yamllint, github-actions/actionlint.
Suppress one line with sudsy-disable-next-line no-undefined-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/undefined-alias |
partial | The shared YAML rule, enabled by the preset for workflows. |
| yamllint | anchors |
full | |
| yamllint | anchors.forbid-undeclared-aliases |
full |