← All recipes
Moderne licensed

Eliminate boolean literal from and/or

Recipe IDorg.openrewrite.python.cleanup.RemoveRedundantBooleanArtifactopenrewrite-static-analysis

Strip `True or False from and/or expressions where the literal has no effect on the result, e.g. True and val reduces to val and False and val reduces to False`.

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.RemoveRedundantBoolean

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-static-analysis