Boolean checks should not be inverted
Recipe ID
org.openrewrite.python.codequality.BooleanChecksNotInvertedArtifactopenrewrite-migrate-pythonReplace inverted boolean comparisons like not (a == b) with the equivalent direct operator (a != b), and remove double negations like not (not x).
Single recipepythoncode-qualityRSPEC-S1940Proprietary
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.BooleanChecksNotInvertedIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-migrate-python