From 8c86fd06dbbac9ecff5129d5f098c41d94e8d294 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 4 Feb 2022 16:00:44 +0100 Subject: [PATCH] add changelog linkifier util --- test/helper_tools/linkify-changelog.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/helper_tools/linkify-changelog.py diff --git a/test/helper_tools/linkify-changelog.py b/test/helper_tools/linkify-changelog.py new file mode 100644 index 000000000..78f6a26af --- /dev/null +++ b/test/helper_tools/linkify-changelog.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +from pathlib import Path +import re + +changelog = Path(__file__).parent / "../../CHANGELOG.md" + +text = changelog.read_text(encoding="utf8") +text, n = re.subn( + r"\s*\(([^)]+)#(\d+)\)", + "\n (\\1[#\\2](https://github.com/mitmproxy/mitmproxy/issues/\\2))", + text +) +changelog.write_text(text, encoding="utf8") +print(f"Linkified {n} issues and users.")