Prefer set literals in in membership tests
Recipe ID
org.openrewrite.python.cleanup.CollectionIntoSetArtifactopenrewrite-static-analysisWhen a list or tuple of literals appears on the right side of an in test, convert it to a set literal for constant-time lookup.
Single recipeProprietary
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.CollectionIntoSetIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis