adrienverge / yamllint

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

Need rules to enforce string quoting for keys #617

Closed HenryGessau closed 11 months ago

HenryGessau commented 1 year 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.