You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix for used-dummy-variable (RUF052) in Ruff 0.8.2 can introduce errors when renaming a function parameter. It should be marked unsafe in that context unless the parameter is positional-only.
Great catch @dscorbett. We can probably do two things here:
If we see that the binging comes from a function parameter, we can change the autofix so that it iterates through the uses of the function in the function's defining module and also changes those uses
If the function is explicitly marked as private to the module (the module has __all__ and the function does not appear in __all__), we can probably still mark it as safe if we do (1), but otherwise we'd have to mark it as unsafe if the binding comes from a parameter
I like what you propose, but I think it might also just be fine to mark the fix as unsafe for now when the binding comes from a parameter (there are just so many things to consider; what if the function overrides another method?)
The fix for
used-dummy-variable
(RUF052) in Ruff 0.8.2 can introduce errors when renaming a function parameter. It should be marked unsafe in that context unless the parameter is positional-only.The text was updated successfully, but these errors were encountered: