Merge consecutive branches with identical bodies
Recipe ID
org.openrewrite.python.codequality.MergeIdenticalBranchesArtifactopenrewrite-migrate-pythonCombine consecutive if/elif branches that have the same body into a single branch with conditions joined by or.
Single recipepythoncode-qualityRSPEC-S1871Proprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.python.codequality.MergeIdenticalBranchesIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python