4 ms·
I despise YAML but like Markdown. They serve different purposes. Markdown is a light-weight way to format prose. YAML is a config language. Markdown is pret
by sa46 7y ago
I despise YAML but like Markdown. They serve different purposes. Markdown is a light-weight way to format prose. YAML is a config language. Markdown is pretty good at formatting prose. YAML is a disaster confusing syntax unsuitable for configs past about 100 lines.
We have a 1500 line YAML file for our test config because YAML is the one true method for setting up tests. The issues I've run into:
- Indentation errors. Luckily CircleCI has a YAML validator, but the fact that a validator is required isn't great.
- true, false, yes, no. Why?
- date and number coercion vs strings.
- YAML has aliases which in theory let you reuse config. Except you can't compose aliases, like have JavaTest inherit config from GitHubReporter and SlackReporter.
My view is that complex configs should be generated from a reproducible binary, preferable in a real programming language with loops, conditionals, and some form of easy composition. Dhall, jsonnet [2], or Cue [3] are all interesting languages in this space.
[1]: https://dhall-lang.org/ https://dhall-lang.org/
[2]: https://jsonnet.org/ https://jsonnet.org/
[3]: https://news.ycombinator.com/item?id=20362951 https://news.ycombinator.com/item?id=20362951