-
-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check-json doesn't detect duplicate keys #554
Comments
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? |
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. Following is the local verification - |
I commented on the PR 👍 |
Thanks @AdityaKhursale @asottile 👍 |
Can this check be made optional, so there is an option to restore the original |
I don't think so, no -- duplicate keys are a mistake |
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 smallobject_pairs_hook
can be used to detect duplicates?The text was updated successfully, but these errors were encountered: