Flatten negated logic via De Morgan's identities
Recipe ID
org.openrewrite.python.cleanup.DeMorganArtifactopenrewrite-static-analysisUse De Morgan's identities to remove double negation and to distribute `not into compound conditions, e.g. not not finished becomes finished and not (m and n) becomes not m or not n`.
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.DeMorganIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis