@hongminhee@hollo.social

I write YAML list items flush with the parent key rather than indented further:

# my preference
items:
- foo
- bar
- baz

# what formatters produce
items:
  - foo
  - bar
  - baz

Every formatter insists on the two-space version instead, so across all my projects, **/*.yaml and **/*.yml end up in deno fmt's exclude list.

The other fixation is .yaml over .yml. The official YAML FAQ has explicitly recommended the longer form for years, but the three-character habit spread through GitHub Actions templates and most people never thought to check.

web.archive.org

YAML Ain't Markup Language

1 reply

@hongminhee I've been thinking that each indent should be replaced with a visible character plus a space — two characters total — for clarity. Indentation itself is enough to express the nested structure and has nice visual representation, but fragile to edit. It looks like your YAML example uses a hyphen as that visible character.