A YAML file cannot contain tabs as indentation

A YAML file use spaces as indentation, you can use 2 or 4 spaces for indentation, but no tab. In other words, tab indentation is forbidden:

Why does YAML forbid tabs?

Tabs have been outlawed since they are treated differently by different editors and tools. And since indentation is so critical to proper interpretation of YAML, this issue is just too tricky to even attempt.

(source: YAML FAQ (thanks to Destiny Architect for the link))

For example, the Symfony configuration file can be written with 2 or 4 spaces as indentation:

4 spaces

doctrine:
    dbal:
        default_connection: default

2 spaces

doctrine:
  dbal:
    default_connection: default

Leave a Comment