Find suspicious chained comparisons
Recipe ID
org.openrewrite.python.codequality.FindSuspiciousChainedComparisonArtifactopenrewrite-migrate-pythonFind 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.FindSuspiciousChainedComparisonIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python