From 2d64e5f5e952c58836f6d137e8599aa67d634e18 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:16:36 +0200 Subject: [PATCH] Convert review discussion into '(comment)' --- src/linkotron/__init__.py | 2 +- tests/test_linkotron.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/linkotron/__init__.py b/src/linkotron/__init__.py index 00a674c..1be8c89 100644 --- a/src/linkotron/__init__.py +++ b/src/linkotron/__init__.py @@ -44,7 +44,7 @@ class Patterns: ) COMMENT = re.compile( rf"^https://github.com/(?P{USERNAME})/(?P{REPO})/" - r"(pull|issues)/(?P\d+)#issuecomment-\d+/?$" + r"(pull|issues)/(?P\d+)#(issuecomment-\d+|discussion_r\d+)/?$" ) diff --git a/tests/test_linkotron.py b/tests/test_linkotron.py index becca26..1f7bbd7 100644 --- a/tests/test_linkotron.py +++ b/tests/test_linkotron.py @@ -24,6 +24,10 @@ "https://github.com/python/peps/pull/2399#issuecomment-1063409480", "python/peps#2399 (comment)", ), + ( + "https://github.com/python/peps/pull/2399#discussion_r823103351", + "python/peps#2399 (comment)", + ), ], ) def test_shorten(link: str, expected: str) -> None: