Browse Source

Merge pull request #2342 from tendermint/dev/changelog2

add script to add links in changelog
pull/2349/head
Ethan Buchman 6 years ago
committed by GitHub
parent
commit
8c0c4844b6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      scripts/linkify_changelog.py

+ 13
- 0
scripts/linkify_changelog.py View File

@ -0,0 +1,13 @@
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)

Loading…
Cancel
Save