← All recipes
Moderne licensed

Drop default-value slice boundaries

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

Omit slice start/stop when they equal `0 and len(seq) respectively, e.g. data[0:len(data)] becomes data[:]`.

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

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

mod config recipes pip install openrewrite-static-analysis