← All recipes
Moderne licensed

Use is not instead of not ... is

Recipe IDorg.openrewrite.python.cleanup.ReplaceNotIsTestArtifactopenrewrite-migrate-python

Replace not x is y with x is not y. The is not operator is clearer than negating an is test. A chained comparison such as not a is b is c is left alone.

Single recipepythoncleanupE714ruffProprietary

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

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

mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:RELEASE
mod config recipes jar install org.openrewrite:rewrite-python:RELEASE