7from rich.syntax
import Syntax
11 Suggested \s changelog \s entry:
19 re.DOTALL | re.VERBOSE,
25api = ghapi.all.GhApi(owner="pybind", repo=
"pybind11")
27issues_pages = ghapi.page.paged(
28 api.issues.list_for_repo, labels=
"needs changelog", state=
"closed"
30issues = (issue
for page
in issues_pages
for issue
in page)
34 changelog = ENTRY.findall(issue.body
or "")
35 if not changelog
or not changelog[0]:
39 if not msg.startswith(
"* "):
41 if not msg.endswith(
"."):
44 msg += f
"\n `#{issue.number} <{issue.html_url}>`_"
46 print(Syntax(msg,
"rst", theme=
"ansi_light", word_wrap=
True))
51 print(
"[blue]" +
"-" * 30)
55 print(f
"[red bold]Missing:[/red bold][red] {issue.title}")
56 print(f
"[red] {issue.html_url}\n")
58 print(
"[bold]Template:\n")
59 msg =
"## Suggested changelog entry:\n\n```rst\n\n```"
60 print(Syntax(msg,
"md", theme=
"ansi_light"))