Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@

SECTIONS = ("Tested", "Not tested", "AI use")
HEADINGS = ("What is in it", "Tested", "Regression run", "Not tested", "AI use")
# placeholder lines copied verbatim from .github/pull_request_template.md (#965)
# placeholder lines copied verbatim from .github/pull_request_template.md (#965) and from the
# outline in CONTRIBUTING.md ("PR description"), which AGENTS.md tells agents to write to
TEMPLATE_PLACEHOLDERS = frozenset({
"hardware (GPU + driver, CPU), Rust version, debug / release:",
"`cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: …)",
"`cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: ...)",
"none / tool and model, and what it did",
"hardware (GPU + driver, CPU), Windows build, Rust version, debug/release",
"commands run and their results, e.g. `cargo test --workspace -- --test-threads=4`: 541 passed, 0 failed, 21 ignored",
"`SKIPPED` GPU tests on your adapter, if any",
"game checked (if any), and what got better, with numbers if you have them",
"what you could not check, e.g. AMD / NVIDIA, the retail title, wave32-only GPUs",
"none / which tool and model (e.g. Claude Code with Claude Opus 5.5), and for what (see below)",
})
# small / open-weight models are not accepted for code (CONTRIBUTING.md, "AI-assisted contributions")
# and their family names: CodeLlama / TinyLlama, CodeQwen / QwQ, Mistral's *stral models, "Phi 4"
Expand Down
14 changes: 14 additions & 0 deletions scripts/test_pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ def test_untouched_pr_template_fails_all_required_sections(self):
problems,
)

def test_untouched_contributing_outline_fails_all_required_sections(self):
contributing = Path(__file__).resolve().parent.parent / "CONTRIBUTING.md"
text = contributing.read_text(encoding="utf-8")
body = text.split("### PR description", 1)[1].split("```markdown\n", 1)[1].split("```", 1)[0]
problems = check(body, HEAD, [changed("README.md")], lambda _: True)
self.assertEqual(
[
"the **Tested** section is missing or empty",
"the **Not tested** section is missing or empty",
"the **AI use** section is missing or empty",
],
problems,
)

def test_filled_template_with_comments_and_real_lines_passes(self):
body = (
"**Tested**\n"
Expand Down
Loading