Closed
Description
The YAML check does this since #351 but since the json
module's default behaviour is to ignore duplicates, duplicates are still possible in JSON. I think a small object_pairs_hook
can be used to detect duplicates?
The YAML check does this since #351 but since the json
module's default behaviour is to ignore duplicates, duplicates are still possible in JSON. I think a small object_pairs_hook
can be used to detect duplicates?
Activity
MiHarsh commentedon Feb 7, 2021
Hello Sir, I didn't understand exactly what we have to do. Do we need to add something to check for duplicates? If duplicate values found then we need to raise error? or something else? Please help !!
Do we need to return retval = 1 if found duplicates,so as to denote error in the file?
AdityaKhursale commentedon Feb 16, 2021
Hi @asottile
I opened PR #558 for this issue. Did local verification for +ve/-ve test scenarios.
However, CI is failing. Could you please help review and let me know what need to be changed?
This is my first contribution in this repo. I am not very familiar with CI checks here and also, fairly new to open source.
Would appreciate your help.
Following is the local verification -
asottile commentedon Feb 16, 2021
I commented on the PR 👍
adamchainz commentedon Feb 18, 2021
Thanks @AdityaKhursale @asottile 👍
marcindulak commentedon Aug 28, 2021
Can this check be made optional, so there is an option to restore the original
check-json
behavior where duplicate keys are allowed? @asottileasottile commentedon Aug 28, 2021
I don't think so, no -- duplicate keys are a mistake