Report duplicate keys in check_json · TomsCodingCode/pre-commit-hooks@fe37451 · GitHub
Skip to content

Commit fe37451

Browse files
AdityaKhursaleasottile
authored andcommitted
Report duplicate keys in check_json
Raise ValueError and return 1 if json contains duplicate keys
1 parent 11a2fdb commit fe37451

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

pre_commit_hooks/check_json.py

Lines changed: 17 additions & 1 deletion
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"hello": "world",
3+
"hello": "planet"
4+
}

tests/check_json_test.py

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)