← All recipes
Moderne licensed

Remove explicit True/False comparisons

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

Drop unnecessary `== True, != False, and similar tests against boolean literals, leaving just the expression or not expr`.

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

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

mod config recipes pip install openrewrite-static-analysis