Skip to content

ref(lint): Run the repo check scripts from one runner - #3952

Merged
BYK merged 4 commits into
mainfrom
chore/check-runner
Nov 21, 2026
Merged

BYK merged 4 commits into
mainfrom
chore/check-runner

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Each root check script had its own node --test … && node … chain in package.json, and pnpm lint listed a dozen of them one by one. Every new check added more of the same wiring.

scripts/check.mjs now owns that wiring:

  • node scripts/check.mjs <name>… runs each named check: first its scripts/check-<file>.test.mjs tests, then its scripts/check-<file>.mjs script. It stops at the first failure.
  • With no name, it runs every check that pnpm lint needs, with their tests in one node --test run.
  • migration-locks still runs squawk after its script.
  • It fails when a scripts/check-*.mjs file has no entry, so a new check gets wired here or not at all.
  • It ignores file-path arguments, because lint-staged appends the staged paths.

Every pnpm <name>:check entry stays and calls the runner, so the check names in AGENTS.md, lint-staged, and CI still work. pnpm lint starts with node scripts/check.mjs, and ast-grep:lint ends with node scripts/check.mjs ast-grep-ignores. The CI release paths include the runner, because release:check now goes through it.

No check script or its logic changes. The packages/junior check scripts keep their own package.json entries.

Related: #3680, #3612.

via @BYK.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested a review from BYK November 21, 2026 19:15
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 21, 2026 7:45pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a77d64d. Configure here.

Comment thread scripts/check.mjs Resolved
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

440 screenshot changes — 0 changed · 440 added · 0 removed

Review screenshots in Frameshift

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally these would come from a common core and are run in parallel in workers so we don't repeat the same file walking logic etc.

Comment thread .github/workflows/ci.yml
Comment on lines 122 to 123
- scripts/release-artifacts*.mjs
- scripts/publish-github-release*.mjs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are here, let's clean up this list as I think most of these files no longer exist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the release filter on main: every entry still matches a tracked file. That includes scripts/release-artifacts.mjs and scripts/publish-github-release.mjs, which the two globs match. The only cleanup I see is turning those two globs into exact paths.

Comment thread scripts/lib/repo-files.mjs Resolved
Comment thread scripts/check.mjs Resolved
@BYK
BYK merged commit 8ce01df into main Nov 21, 2026
57 checks passed
@BYK
BYK deleted the chore/check-runner branch November 21, 2026 21:42
BYK added a commit that referenced this pull request Nov 21, 2026
…3973)

Follow-up to #3952. That PR still kept a hand-written
CHECKS list in the runner, so each new check had to be added in two
places. It also read files synchronously, so a check could not overlap
its file I/O.

**Check discovery.** `scripts/check.mjs` no longer keeps a CHECKS list.
Every `scripts/check-<name>.mjs` is a check named `<name>`. With no
name, the runner runs every check except the ones whose module exports
`lint = false`, each with a comment that says where it runs instead:

- `ast-grep-ignores`: `ast-grep:lint` runs it after the scan.
- `dashboard-bundle-size`, `package-types`, `release-config`: CI runs
them in their own jobs.

Each worker now runs its check's `scripts/check-<name>.test.mjs` before
the check, so the tests run in parallel too. A failing test shows under
that check's `FAIL` line.

The `package.json` `*:check` entries pass the file name. The `pnpm`
script names stay the same, so nothing that calls them changes:
`migration-metadata:check` runs `drizzle-migrations`,
`dashboard-style:check` runs `dashboard-styles`, and `release:check`
runs `release-config`. Only a direct `node scripts/check.mjs <name>`
call has to use the file name now.

**Async reads.** `readRepoFiles` reads with `fs.promises.readFile`, at
most 64 files at a time, and keeps the order. File length now reads
through it too. `mapBounded` moved to `scripts/lib/map-bounded.mjs`, so
the runner and the reader share it.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Acdada5c589dc375265165b968649b09b -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Acdada5c589dc375265165b968649b09b)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acdada5c589dc375265165b968649b09b/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — fca42846 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant