Flatten for/else when the loop has no break

Proprietary

A 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.UselessElseOnLoop
mod run . --recipe=org.openrewrite.python.cleanup.UselessElseOnLoop

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.