Use bracket access for `re.Match` groups
Recipe ID
org.openrewrite.python.cleanup.UseGetitemForReMatchGroupsArtifactopenrewrite-static-analysisReplace `match.group(n) with match[n]` to use the shorter subscript syntax available since Python 3.6.
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.UseGetitemForReMatchGroupsIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis