Skip to content

Commit

Permalink
Update precommit readme script.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaree committed Jun 9, 2021
1 parent 51e10c0 commit af5f703
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,24 @@ def makereadme():
if maybe_version:
_version = maybe_version.group(1)
if info and not info.disabled and not info.hidden:
to_append = [info.name, _version]
to_append = [info.name.strip(), _version.strip()]
description = f"<details><summary>{info.short}</summary>{info.description if info.description != info.short else ''}</details>"
to_append.append(description)
to_append.append(babel_list(info.author, style="standard"))
to_append.append(description.strip())
to_append.append(babel_list(info.author, style="standard").strip())
table_data.append(to_append)

body = tabulate.tabulate(
table_data,
headers=["Name", "Status/Version", "Description (Click to see full status)", "Authors"],
# headers=["Name", "Version", "Description (Click to see full info)", "Author(s)"],
tablefmt="github",
)
file_content = HEADER.format(body=body)
with open(f"{ROOT}/README.md", "r") as outfile:
if re.sub(" +", " ", outfile.read()) == re.sub(" +", " ", file_content):
return 1
with open(f"{ROOT}/README.md", "w") as outfile:
outfile.write(HEADER.format(body=body))
outfile.write(file_content)
return 1


Expand Down

0 comments on commit af5f703

Please sign in to comment.