Merge consecutive branches with identical bodies

Proprietary

Combine consecutive if/elif branches that have the same body into a single branch with conditions joined by or. Branches separated by a comment are left alone.

org.openrewrite.python.codequality.MergeIdenticalBranches
mod run . --recipe=org.openrewrite.python.codequality.MergeIdenticalBranches

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