Skip to content

no-empty-values

GitHub ActionsYAMLstyleno fixdefault: off

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.

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.

Reported
key:
list:
-
full: 1
github-actions:
lint:
rules:
no-empty-values:
level: warn # off (default), warn, error
options:
block_mappings: true
flow_mappings: true
block_sequences: true
yaml:
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.

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