Prefer startswith/endswith over slice comparison
ProprietaryRewrite s[:N] == "lit" as s.startswith("lit") and s[-N:] == "lit" as s.endswith("lit") when the slice length equals the non-zero literal length. It only fires where the type of s resolves to str, and leaves a slice with a step alone.
org. openrewrite. python. cleanup. StrPrefixSuffixmod run . --recipe= org. openrewrite. python. cleanup. StrPrefixSuffixInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.