INNER CODE UNIT · Python
invalid_domain_comment
zachlagden/Pi-hole-Optimized-Blocklists · .github/triage/triage/__main__.py:90
def invalid_domain_comment(request: IssueRequest, state: TriageState) -> str:
raw = render.safe(request.raw_domain, 120) or "nothing"
return (
f"{render.MARKER}\nThe triage bot could not read a valid domain from this issue (it found: `{raw}`). "
"Please edit the domain field so it holds a single domain such as `example.com`, without a path.\n"
+ state.to_marker()
)
def write_dry_run(options, number: int, comment: str | None, embed: dict, png: bytes | None, plan: LabelPlan) -> None:
out = Path(options.out)
out.mkdir(parents=True, exist_ok=True)
if comment:
(out / f"issue-{number}.md").write_text(comment)
(out / f"issue-{number}-discord.json").write_text(json.dumps(embed, indent=2, default=str))
(out / f"issue-{number}-labels.json").write_text(json.dumps({"add": sorted(plan.add), "remove": sorted(plan.remove), "notes": plan.notes}, indent=2))
if png:
(out / f"issue-{number}.png").write_bytes(png)