Collapse boolean ternary to bare condition
Recipe ID
org.openrewrite.python.cleanup.BooleanIfExpIdentityArtifactopenrewrite-static-analysisReplace `True if expr else False with expr and False if expr else True with not expr`, removing the redundant ternary wrapper.
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.BooleanIfExpIdentityIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis