Re:Why are we templating YAML?
by kccqzy on Thursday February 07, 2019 @05:03PM
(#19109033)
I have the same experience. I just think think it is possible to design easy-to-write indentation-sensitive formats but YAML is not. For example is always baffles me that
has a list inside an object but the list is not further indented. There's in fact a hierarchy relationship but absolutely no indentation.
[ Parent
| on HN ]
You can indent it though, but the hyphen already means a list item.
That is a preferred syntax for many that are used to YAML though.
The hyphen is associated with the a though. In what's posted, a is a list, not a map - the type of the parent is being declared by that hyphen.
That's kind of my point. Indentation is optional, so many don't indent, making the resulting document harder to understand.
FWIW, I think yaml / ansible linters and style checkers typically require indentation.
Re:Why are we templating YAML?
by mikepurvis on Thursday February 07, 2019 @05:09PM
(#19109090)
That's at your option, though. It's perfectly valid yaml to indent the list as many spaces as you want.