no-empty-values
What it does
Section titled “What it does”Reports a mapping key or sequence entry without a value (an implicit null), at the : or -. A value with an anchor or tag is not empty. The options block_mappings, flow_mappings and block_sequences choose what is checked.
Why it matters
Section titled “Why it matters”An empty value is null, but it is easy to read as an omission or a value that was lost while editing, and parsers of config files may treat null and a missing key differently.
To fix, write null or ~, or give the key its value.
Example
Section titled “Example”key:list: -full: 1Configuration
Section titled “Configuration”github-actions: lint: rules: no-empty-values: level: warn # off (default), warn, error options: block_mappings: true flow_mappings: true block_sequences: trueyaml: lint: rules: no-empty-values: level: warn # off (default), warn, error options: block_mappings: true flow_mappings: true block_sequences: true| Option | Type | Default | Description |
|---|---|---|---|
block_mappings |
bool | true |
Check block mappings. |
flow_mappings |
bool | true |
Check flow mappings ({a: }). |
block_sequences |
bool | true |
Check block sequences. |
Suppress one line with sudsy-disable-next-line no-empty-values in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| yamllint | empty-values |
full |
| yamllint | empty-values.forbid-in-block-mappings / flow-mappings / block-sequences |
full |