Skip to content

Commit

Permalink
Expand match group explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
pederhan committed Jul 29, 2024
1 parent 3f73f32 commit 67142e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ci/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def unquote_url(match: re.Match[str]) -> str:

def replace_url_id(match: re.Match[str]) -> str:
"""Replace the final number (ID) in a URL with a placeholder."""
# match.group(1) contains the part before the separator
# match.group(2) contains the separator
# match.group(1) contains the part before the separator (`"url": "/api/...`)
# match.group(2) contains the separator (/ or =)
# match.group(3) contains the number we want to replace
# match.group(4) contains the closing double quote
return f"{match.group(1)}{match.group(2)}<ID>{match.group(4)}"
Expand Down

0 comments on commit 67142e7

Please sign in to comment.