← All recipes
Moderne licensed

Rewrite self-multiplication as ** 2

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

When an expression is multiplied by itself, rewrite it using the exponentiation operator (** 2) for clarity.

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

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

mod config recipes pip install openrewrite-static-analysis