#!/usr/bin/env -S uv run # /// script # dependencies = ["ghapi", "rich"] # /// from __future__ import annotations import re import ghapi.all from rich import print from rich.syntax import Syntax MD_ENTRY = re.compile( r""" \#\#\ Suggested\ changelog\ entry: # Match the heading exactly (?:\s*)? # Optionally match one comment (?P.*?) # Lazily capture content until... (?= # Lookahead for one of the following: ^-{3,}\s*$ # A line with 3 or more dashes | ^") print() for msg in msgs: print(Syntax(msg, "md", theme="ansi_light", word_wrap=True)) print() print() if missing: print() print("[blue]" + "-" * 30) print() for issue in missing: print(f"[red bold]Missing:[/red bold][red] {issue.title}") print(f"[red] {issue.html_url}\n") print("[bold]Template:\n") msg = "## Suggested changelog entry:" print(Syntax(msg, "md", theme="ansi_light")) if old: print() print("[red]" + "-" * 30) print() for issue in old: print(f"[red bold]Old:[/red bold][red] {issue.title}") print(f"[red] {issue.html_url}\n") print()