Replies: 3 comments 2 replies
-
It should be rules which allow to set double quote to strings being interpolated and single quotes other cases. |
Beta Was this translation helpful? Give feedback.
-
Please definitely make this optional, as I prefer no quotes unless YAML requires it for unambiguous strings (e.g. strings that begin with Jinja templating, and that's about it). One of the best things about YAML is that I don't need to quote string values in dictionaries unless there would be ambiguity about the syntax of the file. |
Beta Was this translation helpful? Give feedback.
-
Though I also prefer double-quoted strings, it should be noted that buried in Ansible's Windows usage documentation is this strictly-worded YAML style recommendation:
If anything, there should be a rule to enforce single-quoted strings, and non-quoted strings by default. Also, I filed another feature request for ansible-lint to have a rule about quoted style in general: |
Beta Was this translation helpful? Give feedback.
-
In order to avoid discussion about code style, it would be a good idea to add a new rule that requires use of double quotes for escaping strings instead of single quotes, similar to what black does -- this should avoid the issue of mixed quoting.
Because this rule is likely to upset few users, it should be optional.
Beta Was this translation helpful? Give feedback.
All reactions