From 58ce685b613dedab55317ed4d37c6a12c83914ad Mon Sep 17 00:00:00 2001 From: cswimr Date: Fri, 28 Mar 2025 13:12:46 -0500 Subject: [PATCH] style(issuecards): use List.extend() where possible --- issuecards/issuecards.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/issuecards/issuecards.py b/issuecards/issuecards.py index cdf765e..b25119d 100644 --- a/issuecards/issuecards.py +++ b/issuecards/issuecards.py @@ -58,26 +58,26 @@ class IssueCards(commands.Cog): url_pattern = r"(?Phttps?:\/\/[^\/]+)\/(?P[^\/]+)\/(?P[^\/]+)(?:\/-)?\/(?Pissues|discussions|pull|pulls|merge_requests)\/(?P\d+)" matches = [] - for match in re.finditer(identifier_pattern, message.content): - matches.append( - { - "match_type": "identifier", - "prefix": match.group("prefix"), - "gitlab_issue_type": match.group("gitlab_issue_type"), - "issue_number": match.group("issue_number"), - }, - ) - for match in re.finditer(url_pattern, message.content): - matches.append( - { - "match_type": "url", - "base_url": match.group("base_url"), - "author": match.group("author"), - "repository_name": match.group("repository_name"), - "type": match.group("type"), - "number": match.group("number"), - }, - ) + matches.extend( + { + "match_type": "identifier", + "prefix": match.group("prefix"), + "gitlab_issue_type": match.group("gitlab_issue_type"), + "issue_number": match.group("issue_number"), + } + for match in re.finditer(identifier_pattern, message.content) + ) + matches.extend( + { + "match_type": "url", + "base_url": match.group("base_url"), + "author": match.group("author"), + "repository_name": match.group("repository_name"), + "type": match.group("type"), + "number": match.group("number"), + } + for match in re.finditer(url_pattern, message.content) + ) if not matches: return