Drop default slice boundaries

Proprietary

Rewrite seq[0:len(seq)] as seq[:]. It only fires where seq is a side-effect-free name whose type resolves to a builtin sequence such as list or str, and where len is the builtin. A slice with a step is left alone.

org.openrewrite.python.cleanup.RemoveRedundantSliceIndex
mod run . --recipe=org.openrewrite.python.cleanup.RemoveRedundantSliceIndex

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.