Skip to content

Commit

Permalink
Use formatted string to print link to PR in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Konovalov committed Mar 19, 2021
1 parent 2b0e207 commit 187d21e
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions dev/releases/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def changes_overview(prs,startdate):
for k in prs:
# The format of an entry of list is: ["title of PR", "Link" (Alternative the PR number can be used), [ list of labels ] ]
if "release notes: highlight" in prs[k]["labels"]:
# TODO: writing up these details should be a function
title = prs[k]["title"]
f.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
Expand All @@ -122,14 +121,8 @@ def changes_overview(prs,startdate):
removelist = []
for k in prs:
if "release notes: to be added" in prs[k]["labels"]:
f2.write("- [#")
issuenumber = str(k)
f2.write(issuenumber)
f2.write("](")
f2.write("https://github.com/gap-system/gap/pull/" + str(k))
f2.write(") ")
f2.write(prs[k]["title"])
f2.write("\n")
title = prs[k]["title"]
f2.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand All @@ -141,14 +134,8 @@ def changes_overview(prs,startdate):
for k in prs:
#if not "release notes: use title" in item[2]:
if not "release notes: added" in prs[k]["labels"]:
f2.write("- [#")
issuenumber = str(k)
f2.write(issuenumber)
f2.write("](")
f2.write("https://github.com/gap-system/gap/pull/" + str(k))
f2.write(") ")
f2.write(prs[k]["title"])
f2.write("\n")
title = prs[k]["title"]
f2.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand All @@ -160,14 +147,8 @@ def changes_overview(prs,startdate):
removelist = []
for k in prs:
if priorityobject[0] in prs[k]["labels"]:
f.write("- [#")
issuenumber = str(k)
f.write(issuenumber)
f.write("](")
f.write("https://github.com/gap-system/gap/pull/" + str(k))
f.write(") ")
f.write(prs[k]["title"])
f.write("\n")
title = prs[k]["title"]
f.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand Down

0 comments on commit 187d21e

Please sign in to comment.