← All recipes
Moderne licensed

Swap not all()/not any() by negating the comparison

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

Apply De Morgan's law to replace not all(cond ...) with any(negated_cond ...) or not any(cond ...) with all(negated_cond ...).

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

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

mod config recipes pip install openrewrite-static-analysis