Flatten for/else when the loop has no break
ProprietaryA for/else where the loop body never breaks is misleading -- the else runs every time. This moves the else body after the loop. A while/else, a loop whose body contains a break, and an else whose header line carries a comment or holds its body are left alone.
org. openrewrite. python. cleanup. UselessElseOnLoopmod run . --recipe= org. openrewrite. python. cleanup. UselessElseOnLoopInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.