Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Report duplicate keys in check_json#558

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asottile merged 1 commit intopre-commit:masterfromAdityaKhursale:master
Feb 18, 2021

Conversation

@AdityaKhursale
Copy link
Contributor

Raise ValueError and return 1 if json contains duplicate keys

Fixes#554

@asottile
Copy link
Member

there's a few things CI is pointing out that you'll want to fix:

from the tox output:

pre_commit_hooks/check_json.py      29      1      6      1    94%   15->16, 16

this indicates that the code on line 16 is not covered by an automated test -- there's a set of tests for this module in tests/check_json_test.py -- you can probably find some examples there to fix it

from the pre-commit output:

pre_commit_hooks/check_json.py:12: error: Missing type parameters for generic type "Dict"

this indicates that theDict generic does not have its type parameters -- usually these areDict[str, Any] when loading from json. I'm also pretty sure thatHashable =>str in the function signature should be changed too? not 100% sure on that though I'd have to clone and check withpre-commit run mypy --all-files

@AdityaKhursale
Copy link
ContributorAuthor

there's a few things CI is pointing out that you'll want to fix:

from the tox output:

pre_commit_hooks/check_json.py      29      1      6      1    94%   15->16, 16

this indicates that the code on line 16 is not covered by an automated test -- there's a set of tests for this module in tests/check_json_test.py -- you can probably find some examples there to fix it

from the pre-commit output:

pre_commit_hooks/check_json.py:12: error: Missing type parameters for generic type "Dict"

this indicates that theDict generic does not have its type parameters -- usually these areDict[str, Any] when loading from json. I'm also pretty sure thatHashable =>str in the function signature should be changed too? not 100% sure on that though I'd have to clone and check withpre-commit run mypy --all-files

Thank you for the help!
Covered line no. 16 in automated tests. Will update fix for another issue.

@AdityaKhursale
Copy link
ContributorAuthor

Hi@asottile

I have fixed the things reported by CI.
Can you please review and check if PR is good to merge?

Thanks,
Aditya

Copy link
Member

@asottileasottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Raise ValueError and return 1 if json contains duplicate keys
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asottileasottileasottile approved these changes

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

check-json doesn't detect duplicate keys

2 participants

@AdityaKhursale@asottile

[8]ページ先頭

©2009-2025 Movatter.jp