← All recipes
Moderne licensed

Simplify boolean literal comparisons

Recipe IDorg.openrewrite.python.codequality.SimplifyBooleanLiteralArtifactopenrewrite-migrate-python

Replace comparisons against boolean literals (== True, != False, is True, etc.) with the simpler equivalent boolean expression.

Single recipepythoncode-qualityRSPEC-S1125Proprietary

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.codequality.SimplifyBooleanLiteral

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

mod config recipes pip install openrewrite-migrate-python