YAML Formatting Guide: Indentation and Quotes
Format YAML correctly: use consistent 2-space indentation, know when to quote strings, avoid tab characters, and debug indent errors fast.
Published:
Tags: data, yaml, formatting
YAML Formatting Guide: Indentation, Quotes, and Common Mistakes YAML's "human-readable" reputation is conditional. Badly formatted YAML is harder to read than JSON. A missing space after a colon, inconsistent indentation, or an unquoted value that parses as the wrong type will silently break your config — and the error message usually points to somewhere downstream, not the actual problem. This guide covers every formatting decision you'll face writing YAML, with specific rules you can follow and linting tools to enforce them automatically. --- Indentation: The Foundational Rule YAML uses indentation to express hierarchy. Get this wrong and nothing else matters. The Core Rules Use spaces, never tabs. A tab character () in YAML is a parse error. Most editors insert tabs for other languages…
All articles · theproductguy.in