From 2e73c26da875279fc26df030b94ec05fe552f5ff Mon Sep 17 00:00:00 2001 From: Flamki <111645429+Flamki@users.noreply.github.com> Date: Thu, 2 Jul 2026 01:59:14 +0530 Subject: [PATCH] docs: add contributor PR checklist template --- .github/PULL_REQUEST_TEMPLATE.md | 22 ---------------------- .github/pull_request_template.md | 24 ++++++++++++++++++++++++ scripts/pr-checklist.test.tsx | 30 ++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 22 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/pull_request_template.md create mode 100644 scripts/pr-checklist.test.tsx diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b41ac02a..00000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,22 +0,0 @@ -## Summary - -- - -Closes # - -## Validation - -- [ ] `npm run lint` -- [ ] `npm test` -- [ ] `npm run build` - -## Accessibility - -- [ ] Interactive controls have accessible names -- [ ] Keyboard and focus-visible behavior were preserved -- [ ] New or changed UI has relevant Jest/RTL or jest-axe coverage - -## Security - -- [ ] No secrets, wallet keys, `.env` files, or generated artifacts are included -- [ ] API or wallet trust-boundary changes are explained diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..2995e341 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,24 @@ +## Summary + +- + +Closes # + +## Contributor Checklist + +- [ ] Tests were added or updated for the changed behavior. +- [ ] Impacted code meets the 95% coverage expectation, or the gap is explained. +- [ ] Accessibility was verified for UI changes, including keyboard flow, labels, focus states, and contrast. +- [ ] Documentation was updated, or no docs change is needed. +- [ ] `npm run lint`, `npm test`, and `npm run build` pass locally. + +## Review Notes + +- Testing guidance: [TESTING.md](../TESTING.md) +- Accessibility guidance: [docs/accessibility.md](../docs/accessibility.md) +- Contributor workflow: [CONTRIBUTING.md](../CONTRIBUTING.md) + +## Security + +- [ ] No secrets, wallet keys, `.env` files, or generated artifacts are included +- [ ] API or wallet trust-boundary changes are explained diff --git a/scripts/pr-checklist.test.tsx b/scripts/pr-checklist.test.tsx new file mode 100644 index 00000000..638fb04a --- /dev/null +++ b/scripts/pr-checklist.test.tsx @@ -0,0 +1,30 @@ +import fs from "node:fs"; +import path from "node:path"; + +describe("pull request checklist template", () => { + const repoRoot = path.resolve(__dirname, ".."); + const templatePath = path.join(repoRoot, ".github", "pull_request_template.md"); + const template = fs.readFileSync(templatePath, "utf8"); + + it("keeps the contributor checklist focused on review readiness", () => { + for (const requiredText of [ + "Tests were added or updated", + "95% coverage", + "Accessibility was verified", + "Documentation was updated", + "`npm run lint`, `npm test`, and `npm run build`", + ]) { + expect(template).toContain(requiredText); + } + }); + + it("links contributors to testing, accessibility, and workflow docs", () => { + for (const requiredLink of [ + "[TESTING.md](../TESTING.md)", + "[docs/accessibility.md](../docs/accessibility.md)", + "[CONTRIBUTING.md](../CONTRIBUTING.md)", + ]) { + expect(template).toContain(requiredLink); + } + }); +});