hyphens¶
What this rule does¶
Controls the number of spaces between the hyphen (-) and the value in
block sequences.
Why this matters¶
- Alignment. Consistent spacing keeps sequence items lined up under the same column, which matters for readability of long lists.
- Diff stability. Editors that "fix" hyphen spacing during a save produce noisy diffs when the rule is unset.
Configuration¶
| Option | Default | Description |
|---|---|---|
max-spaces-after |
1 |
Maximum spaces between the - and the item value. |
Examples¶
Allowed (defaults)¶
Reported (defaults)¶
Allowed (with max-spaces-after: 3)¶
Automatic fixing¶
This rule does not auto-fix; trim the extra spaces manually.
Related rules¶
indentation— controls how sequence items are indented relative to their parent key.bracketsandcommas— the flow sequence equivalents.