YAML Indentation and Structure/Sequence nested under a key

Indent list items under their parent key.

Section: Indentation rules

Sequence nested under a key

yaml
yaml
services:
  - api
  - web
  - worker
Explanation

List items should align consistently under the key they belong to.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Indentation rules
Two-space indentation
Use consistent spaces for nested levels.
OpenIn sheetyamlsame section
Mixed indentation example
Illustrate a broken file caused by inconsistent nesting.
OpenIn sheetyamlsame section
Mappings inside a sequence
Represent a list of objects cleanly.
OpenIn sheetyamlsame section
Run yamllint with a custom config
Use a project-specific lint profile.
OpenIn sheetbash1 tag match
Reveal hidden whitespace
Print tabs and line endings to spot indentation issues.
OpenIn sheetbash1 tag match
Find tabs in YAML files
Locate tab characters that may break parsing.
OpenIn sheetbash1 tag match