From 0881068d76c3d7868365845a91e01862552c4822 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Wed, 5 Sep 2018 15:58:29 -0700 Subject: [PATCH] add script to add links in changelog --- scripts/linkify_changelog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/linkify_changelog.py diff --git a/scripts/linkify_changelog.py b/scripts/linkify_changelog.py new file mode 100644 index 00000000..16647c05 --- /dev/null +++ b/scripts/linkify_changelog.py @@ -0,0 +1,13 @@ +import fileinput +import re + +# This script goes through the provided file, and replaces any " \#", +# with the valid mark down formatted link to it. e.g. +# " [\#number](https://github.com/tendermint/tendermint/issues/) +# Note that if the number is for a PR, github will auto-redirect you when you click the link. +# It is safe to run the script multiple times in succession. +# +# Example usage $ python3 linkify_changelog.py ../CHANGELOG_PENDING.md +for line in fileinput.input(inplace=1): + line = re.sub(r"\s\\#([0-9]*)", r" [\\#\1](https://github.com/tendermint/tendermint/issues/\1)", line.rstrip()) + print(line) \ No newline at end of file