← All recipes
Moderne licensed

Replace not x in y with x not in y

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

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

Single recipepythonE713cleanupruffProprietary

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

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