← All recipes
Moderne licensed

Find suspicious chained comparisons

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

Find chained comparisons that mix </<= with >/>= (for example 0 <= x >= 10), where the links point in opposite directions and the chain is almost always a mistake.

Single recipepythoncode-qualityProprietary

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

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

mod config recipes pip install openrewrite-migrate-python