Replace self-referencing ternary with or
Recipe ID
org.openrewrite.python.cleanup.OrIfExpIdentityArtifactopenrewrite-static-analysisWhen a ternary's condition and true-branch name the same variable, rewrite `val if val else fallback as val or fallback` to avoid repeating the name.
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.OrIfExpIdentityIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis