-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use correct range for TRIO115
fix
#8933
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
|
@@ -103,7 +103,7 @@ pub(crate) fn zero_sleep_call(checker: &mut Checker, call: &ExprCall) { | |||
)?; | |||
let reference_edit = | |||
Edit::range_replacement(format!("{binding}.checkpoint"), call.func.range()); | |||
let arg_edit = Edit::range_deletion(call.arguments.range); | |||
let arg_edit = Edit::range_deletion(arg.range()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this range be incorrect if the user uses a keyword argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want "replace call.arguments.range with ()".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm out now but I think that should still work as arg
is either a positional or keyword argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But arg
is just the value, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #8936.
Summary
This PR fixes the bug where the autofix for
TRIO115
was taking the entire arguments range for the fix which included the parenthesis as well. This means that the fix would remove the arguments and the parenthesis. The fix is to use the correct range.fixes: #8713
Test Plan
Update existing snapshots :)