Skip to content
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

Automatically remove duplicate dictionary keys #1710

Merged
merged 2 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ For more, see [Pyflakes](https://pypi.org/project/pyflakes/2.5.0/) on PyPI.
| F524 | StringDotFormatMissingArguments | '...'.format(...) is missing argument(s) for placeholder(s): ... | |
| F525 | StringDotFormatMixingAutomatic | '...'.format(...) mixes automatic and manual numbering | |
| F541 | FStringMissingPlaceholders | f-string without any placeholders | 🛠 |
| F601 | MultiValueRepeatedKeyLiteral | Dictionary key literal repeated | |
| F602 | MultiValueRepeatedKeyVariable | Dictionary key `...` repeated | |
| F601 | MultiValueRepeatedKeyLiteral | Dictionary key literal `...` repeated | 🛠 |
| F602 | MultiValueRepeatedKeyVariable | Dictionary key `...` repeated | 🛠 |
| F621 | ExpressionsInStarAssignment | Too many expressions in star-unpacking assignment | |
| F622 | TwoStarredExpressions | Two starred expressions in assignment | |
| F631 | AssertTuple | Assert test is a non-empty tuple, which is always `True` | |
Expand Down
38 changes: 38 additions & 0 deletions resources/test/fixtures/pyflakes/F601.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,41 @@
b"123": 1,
b"123": 4,
}

x = {
"a": 1,
"a": 2,
"a": 3,
"a": 3,
}

x = {
"a": 1,
"a": 2,
"a": 3,
"a": 3,
"a": 4,
}

x = {
"a": 1,
"a": 1,
"a": 2,
"a": 3,
"a": 4,
}

x = {
a: 1,
"a": 1,
a: 1,
"a": 2,
a: 2,
"a": 3,
a: 3,
"a": 3,
a: 4,
}

x = {"a": 1, "a": 1}
x = {"a": 1, "b": 2, "a": 1}
38 changes: 38 additions & 0 deletions resources/test/fixtures/pyflakes/F602.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,41 @@
a: 2,
b: 3,
}

x = {
a: 1,
a: 2,
a: 3,
a: 3,
}

x = {
a: 1,
a: 2,
a: 3,
a: 3,
a: 4,
}

x = {
a: 1,
a: 1,
a: 2,
a: 3,
a: 4,
}

x = {
a: 1,
"a": 1,
a: 1,
"a": 2,
a: 2,
"a": 3,
a: 3,
"a": 3,
a: 4,
}

x = {a: 1, a: 1}
x = {a: 1, b: 2, a: 1}
Loading