Rewrite self-multiplication as ** 2
ProprietaryWhen an expression is multiplied by itself, rewrite it using the exponentiation operator (** 2) for clarity. Only fires where the operand's type resolves to int and it has no side effects, since a large float overflows under **. A literal times itself, such as 60 * 60, or a product holding comments is left alone.
org. openrewrite. python. cleanup. SquareIdentitymod run . --recipe= org. openrewrite. python. cleanup. SquareIdentityInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.