chore: enforce pre-PR validation (aggregate scripts, git hooks, PR checklist)#1061
Merged
Merged
Conversation
…nd PR checklist Add tooling to help contributors run the same checks as CI before submitting a pull request, reducing avoidable format/lint/build failures. - Add aggregate npm scripts: - `npm run check` runs format-check + lint + build + test (mirrors CI) - `npm run fix` runs format + lint:fix + build - Add husky + lint-staged git hooks (installed via `npm install`): - pre-commit formats and lints staged files - pre-push rebuilds dist/ and runs the test suite - Add a checklist item to the PR template prompting contributors to run `npm run check` locally - Document the aggregate scripts and hooks in docs/contributors.md dist/ is intentionally not auto-committed by CI to avoid pwn-request security risks; the existing `Check dist/` workflow continues to verify it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds local, contributor-facing tooling to reduce avoidable CI failures by making the repo’s standard format/lint/build/test validations easier to run (via aggregate scripts) and harder to forget (via git hooks + checklist/docs).
Changes:
- Added aggregate npm scripts (
check,fix) and configuredlint-staged. - Introduced Husky-managed
pre-commitandpre-pushhooks to run staged formatting/linting and build/tests. - Updated contributor documentation and PR template to prompt running
npm run check.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds aggregate scripts, prepare hook install, lint-staged config, and new dev deps (husky/lint-staged). |
| package-lock.json | Locks new dev dependencies and their transitive dependencies. |
| docs/contributors.md | Documents the new check/fix scripts and the automated hooks. |
| .husky/pre-commit | Adds a pre-commit hook invoking lint-staged. |
| .husky/pre-push | Adds a pre-push hook running build + tests. |
| .github/pull_request_template.md | Adds a checklist item to run npm run check locally. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/6 changed files
- Comments generated: 4
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gdams
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Contributors occasionally open PRs that fail CI for avoidable reasons — most often Prettier
format-checkviolations or a staledist/bundle — because the local format/lint/build/test steps weren't run before pushing. This PR adds lightweight tooling to make those checks easy to run and hard to forget.This implements the agreed-upon enforcement measures (the maintainer enabled required status checks separately):
Aggregate npm scripts
npm run check→format-check+lint+build+test(mirrors what CI runs).npm run fix→format+lint:fix+build.Git hooks (husky + lint-staged)
Installed automatically on
npm installvia thepreparescript:lint-staged(Prettier + ESLint--fixon staged*.ts, Prettier on staged*.{yml,yaml}).npm run build && npm test.PR template & docs
npm run checklocally.docs/contributors.md.Why
dist/is not auto-committed by CIAuto-committing the rebuilt
dist/bundle from CI was deliberately excluded: writing to the repo from workflows that run untrusted PR code is a pwn-request security risk. The existingCheck dist/workflow continues to verify the committed bundle matches source.Related issue
Follow-up to the maintenance discussion about contributors not running pre-PR checks (PRs #672 and #1017 failed solely on Prettier formatting).
Check list
npm run checklocally (format, lint, build pass; the only failing test is a network-dependent JetBrains test that cannot reach CloudFront in the sandbox).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com