diff --git a/ghrepo.py b/ghrepo.py index 29ef09a..cd1e23c 100644 --- a/ghrepo.py +++ b/ghrepo.py @@ -10,6 +10,7 @@ Severity = Literal["ok", "low", "high"] Criteria = tuple[str, Severity] + @dataclass class GitHubRepo: """Class that contains all relevant info about a GitHub repository""" @@ -122,11 +123,13 @@ async def get_readme(full_name: str, token: str | None = None) -> str | None: readme_b64 = readme_response.json().get("content") return b64decode(readme_b64).decode() + def compute_readability(readme_txt: str): """Compute readability from readme markdown text.""" # TODO: strip markdown before computing readability return textstat.textstat.flesch_reading_ease(readme_txt) + async def get_org_repos(org: str, token: str | None = None) -> list[GitHubRepo]: """Get all the public repos for an organisation.""" head = {"Authorization": f"Bearer {token}"} if token else {} diff --git a/main.py b/main.py index eb9a762..e76a10a 100644 --- a/main.py +++ b/main.py @@ -19,9 +19,7 @@ elif expiration.days < 30: PAT_MSG = f"PAT expiring in {expiration.days} days." else: - PAT_MSG = ( - "Not using a personal access token, please create & add it to the repo's secrets:" - ) + PAT_MSG = "Not using a personal access token, please create & add it to the repo's secrets:" # First, load the configuration file diff --git a/public/style.css b/public/style.css index 34b4d9e..4b9fb19 100644 --- a/public/style.css +++ b/public/style.css @@ -39,8 +39,9 @@ a:hover { .main-header { display: grid; - grid-template-columns: 1fr 3fr; + grid-template-columns: 1fr 2fr 1fr; margin-bottom: 2em; + text-align: right; } .main-header img { diff --git a/web/macros.jinja2 b/web/macros.jinja2 index 37cfe63..79a55bb 100644 --- a/web/macros.jinja2 +++ b/web/macros.jinja2 @@ -1,10 +1,11 @@ {% macro render_header(title, subtitle, patmsg) %}
+

{{ title }}

{% if patmsg != None %} -

{{ patmsg }} renew here

+

{{ patmsg }} create PAT here

{% endif %}