Skip to content

Commit

Permalink
Simplify regex: drop unnecessary groups
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-antognini-sonarsource committed Dec 16, 2024
1 parent 1abfb8f commit e056c0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rspec-tools/rspec_tools/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

DEPENDENCY_RE = re.compile(r'''\bdependency\s+['"](?:com|org)\.sonarsource\.[\w.-]+:(?P<plugin_name>[\w-]+):(?P<version>\d+(\.\d+)+)['"]''')

BUNDLED_SIMPLE = r'''['"](?:com|org)\.sonarsource\.(?:[\w.-]+):(?P<plugin_name>[\w-]+)['"]'''
BUNDLED_MULTI = r'''\(\s*group:\s*['"]([\w.-]+)['"],\s*name:\s*['"](?P<plugin_name2>[\w-]+)['"],\s*classifier:\s*['"][\w-]+['"]\s*\)'''
BUNDLED_SIMPLE = r'''['"](?:com|org)\.sonarsource\.[\w.-]+:(?P<plugin_name>[\w-]+)['"]'''
BUNDLED_MULTI = r'''\(\s*group:\s*['"][\w.-]+['"],\s*name:\s*['"](?P<plugin_name2>[\w-]+)['"],\s*classifier:\s*['"][\w-]+['"]\s*\)'''
BUNDLED_RE = re.compile(rf'\bbundledPlugin\s+({BUNDLED_SIMPLE}|{BUNDLED_MULTI})')


Expand Down

0 comments on commit e056c0f

Please sign in to comment.