imbal / safeyaml

SafeYAML: A linter for YAML-favoured JSON (& autoformatting too!)
240 stars 11 forks source link

Ansible playbooks #7

Open marksutherland opened 6 years ago

marksutherland commented 6 years ago

The conventions around ansible playbooks possibly mean they are never going to be safeyaml compliant. For example, they encourage starting files with the --- separator, and make extensive use of lists-of-maps.

aanand commented 6 years ago

As far as I can tell, the --- separator is for separating out a stream of objects, which seems like a feature geared towards a serialization/deserialization use case. I'm not at all interested in supporting that use case, so at first blush it seems like we should strip it out if we find it, and error out if we find that the input is in fact a stream of multiple objects.

Thoughts on lists-of-maps here: https://github.com/imbal/safeyaml/issues/4#issuecomment-359749524

tef commented 6 years ago

We can strip out the first or last --- possibly. Right now, it errors on sight