Substitute constant collection condition with boolean
Recipe ID
org.openrewrite.python.cleanup.CollectionToBoolArtifactopenrewrite-static-analysisWhen a list, tuple, dict, or set literal is used as an `if or while condition, replace it with True (non-empty) or False` (empty) to state the intent directly.
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.CollectionToBoolIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis