Linkify changelog (#46)
Dev Ojha ValarDragon@users.noreply.github.com
Tue, 23 Mar 2021 13:59:51 -0500
3 files changed,
58 insertions(+),
7 deletions(-)
A
.github/workflows/linkify_changelog.yml
@@ -0,0 +1,20 @@
+name: Linkify Changelog + +on: + workflow_dispatch + +jobs: + linkify: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Add links + run: python3 scripts/linkify_changelog.py CHANGELOG.md + - name: Commit + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Linkify Changelog" + git push
M
CHANGELOG.md
→
CHANGELOG.md
@@ -4,7 +4,7 @@ ### Breaking changes
- Requires all crates from `arkworks-rs/algebra` to have version `v0.2.0` or greater. ### Features -- #3 Add constraints for +- [\#3](https://github.com/arkworks-rs/curves/pull/3) Add constraints for `ark-bls12-377`, `ark-ed-on-bls12-377`, `ark-ed-on-bls12-381`,@@ -17,16 +17,16 @@ `ark-mnt4-298`,
`ark-mnt6-298`, `ark-mnt4-753`, `ark-mnt6-753`. -- #7 Add benchmarks for Edwards curves. -- #19 Change field constants to be provided as normal strings, instead of in montgomery form. +- [\#7](https://github.com/arkworks-rs/curves/pull/7) Add benchmarks for Edwards curves. +- [\#19](https://github.com/arkworks-rs/curves/pull/19) Change field constants to be provided as normal strings, instead of in montgomery form. ### Improvements -- #42 Remove the dependency of `rand_xorshift`. +- [\#42](https://github.com/arkworks-rs/curves/pull/42) Remove the dependency of `rand_xorshift`. ### Bug fixes -- #28 Fix broken documentation links. -- #38 Compile with `panic='abort'` in release mode, for safety of the library across FFI boundaries. -- #45 Fix `ark-ed-on-mnt4-753`. +- [\#28](https://github.com/arkworks-rs/curves/pull/28) Fix broken documentation links. +- [\#38](https://github.com/arkworks-rs/curves/pull/38) Compile with `panic='abort'` in release mode, for safety of the library across FFI boundaries. +- [\#45](https://github.com/arkworks-rs/curves/pull/45) Fix `ark-ed-on-mnt4-753`. ## v0.1.0
A
scripts/linkify_changelog.py
@@ -0,0 +1,31 @@
+import re +import sys +import fileinput +import os + +# Set this to the name of the repo, if you don't want it to be read from the filesystem. +# It assumes the changelog file is in the root of the repo. +repo_name = "" + +# 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/arkworks-rs/template/pull/<number>) +# Note that if the number is for a an issue, 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.md +if len(sys.argv) < 2: + print("Must include path to changelog as the first argument to the script") + print("Example Usage: python3 linkify_changelog.py ../CHANGELOG.md") + exit() + +changelog_path = sys.argv[1] +if repo_name == "": + path = os.path.abspath(changelog_path) + components = path.split(os.path.sep) + repo_name = components[-2] + +for line in fileinput.input(inplace=True): + line = re.sub(r"\- #([0-9]*)", r"- [\\#\1](https://github.com/arkworks-rs/" + repo_name + r"/pull/\1)", line.rstrip()) + # edits the current file + print(line)