← All recipes
Moderne licensed

Delete no-op assert True statements

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

Delete bare assert True statements, which are always satisfied and have no effect. Assertions that carry a message string are preserved.

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

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

mod config recipes pip install openrewrite-static-analysis