no-flow-sequences
What it does
Section titled “What it does”Reports a flow sequence ([a, b]), on its opening bracket. With allow_empty, an empty one ([]) is not reported.
Why it matters
Section titled “Why it matters”Block style is the main style of YAML: one item to a line, with diffs that show a single changed item. A flow sequence packs items on one line, so a change touches the whole line and long ones wrap badly.
To fix, write one - item per line.
Example
Section titled “Example”With this configuration:
no-flow-sequences: level: warn options: allow_empty: truea: [1, 2]b: []c: [ # note ]Configuration
Section titled “Configuration”github-actions: lint: rules: no-flow-sequences: level: warn # off (default), warn, error options: allow_empty: falseyaml: lint: rules: no-flow-sequences: level: warn # off (default), warn, error options: allow_empty: false| Option | Type | Default | Description |
|---|---|---|---|
allow_empty |
bool | false |
Do not report empty collections ({}, []). |
Suppress one line with sudsy-disable-next-line no-flow-sequences 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 | brackets.forbid |
full |