From d7919b6989847297c0c29b00529d2b67bd9d64b0 Mon Sep 17 00:00:00 2001 From: Ben Parsons Date: Tue, 31 Jul 2018 15:08:42 +0100 Subject: [PATCH] also scrape PRs when the full URL is pasted --- scripts/proposals.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/proposals.py b/scripts/proposals.py index a8f58cae..d8c1aa24 100755 --- a/scripts/proposals.py +++ b/scripts/proposals.py @@ -138,10 +138,15 @@ for label in labels: pr_list_formatted = set() pr_list = pr_list.group(1) for p in pr_list.split(","): - if not re.match(r"#\d", p.strip()): + if re.match(r"#\d", p.strip()): + prs.add(p.strip()) + pr_list_formatted.add("`PR" + str(p.strip()) + "`_") + elif re.match(r"https://github.com/matrix-org/matrix-doc/pulls/\d", p.strip()): + pr = "#" + p.strip().replace('https://github.com/matrix-org/matrix-doc/pulls/', '') + prs.add(pr) + pr_list_formatted.add("`PR" + str(pr) + "`_") + else: raise RuntimeWarning - prs.add(p.strip()) - pr_list_formatted.add("`PR" + str(p.strip()) + "`_") text_file.write(" - " + ', '.join(pr_list_formatted)) text_file.write("\n") else: