Simplify a negated elif to else

Proprietary

When an elif condition is the exact negation of the preceding if, replace it with else since the test is redundant. A condition that may have side effects, such as a call, and an elif followed by its own else are left alone.

org.openrewrite.python.cleanup.RemoveRedundantIf
mod run . --recipe=org.openrewrite.python.cleanup.RemoveRedundantIf

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