← All recipes
Moderne licensed

Pass iterable directly to any()/all() instead of identity generator

Recipe IDorg.openrewrite.python.cleanup.SimplifyGeneratorArtifactopenrewrite-static-analysis

An identity generator that yields every element unchanged is redundant inside any() or all() -- pass the collection 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.SimplifyGenerator

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

mod config recipes pip install openrewrite-static-analysis