mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-05 03:35:52 +00:00
Automate things (#117)
This pull requests contains the basic automation scripts as described in `ISSUE_TEMPLATES/README.md`. Feps needed to be changed to continue links to their tracking issues. - [x] Description of how to best merge a pull request still missing - [x] Rename folder ISSUE_TEMPLATES to something better. Co-authored-by: Helge <helge.krueger@gmail.com> Reviewed-on: https://codeberg.org/fediverse/fep/pulls/117
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from tools import FepFile, get_fep_ids
|
||||
|
||||
fep_files = [FepFile(fep) for fep in get_fep_ids()]
|
||||
fep_files = reversed(fep_files)
|
||||
fep_files = sorted(fep_files, key=lambda x: x.parsed_frontmatter["dateReceived"])
|
||||
|
||||
result = []
|
||||
|
||||
|
||||
def build_url_link(url):
|
||||
url_number = url.split("/")[-1]
|
||||
return f"[#{url_number}]({url})"
|
||||
|
||||
|
||||
for fep in fep_files:
|
||||
link = f"[FEP-{fep.fep}: {fep.title}](./{fep.filename})"
|
||||
parsed = fep.parsed_frontmatter
|
||||
|
||||
if "discussionsTo" in parsed:
|
||||
url = parsed["discussionsTo"]
|
||||
urls = url.split(", ")
|
||||
discussions = " ".join(build_url_link(url) for url in urls)
|
||||
else:
|
||||
discussions = ""
|
||||
|
||||
if "dateFinalized" in parsed:
|
||||
date_final = parsed["dateFinalized"]
|
||||
else:
|
||||
date_final = "-"
|
||||
result.append(
|
||||
f"""| {link} | `{parsed["status"]}` | {discussions} | {parsed["dateReceived"]} | {date_final} |\n"""
|
||||
)
|
||||
|
||||
|
||||
# | [FEP-a4ed: The Fediverse Enhancement Proposal Process](./fep/a4ed/fep-a4ed.md) | `FINAL` | [#10](https://git.activitypub.dev/ActivityPubDev/Fediverse-Enhancement-Proposals/issues/10) | 2020-10-16 | 2020-01-18
|
||||
|
||||
|
||||
with open("README.md", "w") as f1:
|
||||
with open("scripts/frontmatter.md") as f:
|
||||
f1.write(f.read().removesuffix("\n"))
|
||||
|
||||
f1.writelines(result)
|
||||
|
||||
with open("scripts/backmatter.md") as f:
|
||||
f1.write(f.read())
|
||||
Reference in New Issue
Block a user