-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations
Description
This is a case which I believe is potentially indicative of other bugs with the F601 fix.
Duplicated keys are merged by Ruff in the case of equal values, but the method by which this is done leads to a strange error in the case of different parenthesisation:
t={"x":"test123", "x":("test123")}And the applied diff:
Fixed source has a syntax error where the source document does not. This is a bug in one of the generated fixes:
<filename>:1:17: E999 SyntaxError: unexpected token ')'
|
1 | t={"x":"test123")}
| ^ E999
|
Last generated fixes:
<filename>:1:19: F601 [*] Dictionary key literal `"x"` repeated
|
1 | t={"x":"test123", "x":("test123")}
| ^^^ F601
|
= help: Remove repeated key literal `"x"`
ℹ Suggested fix
1 |-t={"x":"test123", "x":("test123")}
1 |+t={"x":"test123")}
Source with applied fixes:
t={"x":"test123")}
Discovered by #4822.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations