Revision d59c586d4defea76eaefbe9a4b7de747d610d268 authored by William Banfield on 06 September 2022, 14:29:29 UTC, committed by William Banfield on 06 September 2022, 14:29:29 UTC
2 parent s b3a2c1d + 101bf50
Raw File
linkify_changelog.py
import fileinput
import re

# This script goes through the provided file, and replaces any " \#<number>",
# with the valid mark down formatted link to it. e.g.
# " [\#number](https://github.com/tendermint/tendermint/issues/<number>)
# 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)
back to top