Make yaml check error on duplicate keys
See original GitHub issueWe make this mistake all the time:
# foo.yaml
'key1': false
'key2': true
'key1': true
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Duplicate key in YAML configuaration file - Stack Overflow
Your error is that key1 is used two times as mapping key in the root node. ... The solution is to make all...
Read more >Duplicate keys - HitchDev
Duplicate keys are allowed in regular YAML - as parsed by pyyaml, ruamel.yaml and poyo: Not only is it unclear whether x should...
Read more >How to detect duplicate tags in an input YAML files?
If both forms are used as keys in the same mapping, only a YAML processor which recognizes integer formats would correctly flag the...
Read more >ruamel.yaml 0.16.1 - PyPI
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of ... duplicate keys are now an error when working with the old API...
Read more >Repeated key in YAML files [#3256376] | Drupal.org
Check all YAML files for duplicate keys. Remaining tasks. User interface changes. API changes. Data model changes. Comment ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am not sure about
check-yaml
implementation but I am using the yamllint linter which is probably the most advanced, and it does catch duplicate keys.Obviously that this should not be taken as a reason not to fix it official pre-commit hooks. I would myself support getting yamllint into main repo, maybe even removing the check-yaml one.
@asottile 😞😞