Remove conditional with identical branches
Recipe ID
org.openrewrite.python.codequality.AllBranchesIdenticalArtifactopenrewrite-migrate-pythonReplace if/elif/else chains where every branch has the same body with just the body, since the condition has no effect on what code executes.
Single recipepythonRSPEC-S3923code-qualityProprietary
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.AllBranchesIdenticalIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python