Remove self-assignments
ProprietaryRemove statements inside a function that assign a parameter to itself (x = x), since they have no effect. Any other local is left alone, since x = x raises UnboundLocalError where nothing bound x first. Class-body and module-level X = X bind a new name from an enclosing one and are left alone, as are attribute and subscript targets, which run __set__ and __setitem__.
org. openrewrite. python. codequality. RemoveSelfAssignmentmod run . --recipe= org. openrewrite. python. codequality. RemoveSelfAssignmentInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.