adrienverge / yamllint

A linter for YAML files.
GNU General Public License v3.0
2.83k stars 269 forks source link

Need rules to enforce string quoting for keys #617

Closed HenryGessau closed 9 months ago

HenryGessau commented 9 months ago

The current quoted-strings rule does not check keys.

Consider:

---
one: 1
'two': 2
"three": 3
["a", b]: 4
{'a': a, b: 'b'}: 5

There is currently no rule to enforce consistent quoting for key strings.

The quoted-strings rule can be extended with an option to also check keys. However, there may be a need to have different quoting rules for key strings and value strings.