← All recipes
Moderne licensed

Drop `pass-only elif` by negating its condition

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

When an `elif body is only pass and an else follows, invert the elif` condition and absorb the else body.

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

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

mod config recipes pip install openrewrite-static-analysis