Collapse nested `if into a single and` condition
Recipe ID
org.openrewrite.python.cleanup.MergeNestedIfsArtifactopenrewrite-static-analysisWhen two `if statements are nested with no else on either, join their conditions with and` and flatten the body.
Single recipeProprietary
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.cleanup.MergeNestedIfsIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis