Skip to content

tools check: the format gate runs CI's format check, so --fast catches what CI's would - #191

Merged
agorischek merged 1 commit into
mainfrom
agorischek/fast-format-parity
Nov 22, 2026
Merged

agorischek merged 1 commit into
mainfrom
agorischek/fast-format-parity

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

tools check --fast passed locally on #189 and #190 while CI's oxfmt --check failed. This makes --fast run the format check CI runs.

Cause. With --fast or --affected, the format gate checked only changed files whose extension matched /\.([cm]?[jt]sx?|json|jsonc|ya?ml|css|html|toml)$/, which leaves out Markdown. I reproduced both PRs at the commits CI failed on:

Fix. The format gate runs npm run format:check (CI's own oxfmt --check) in every mode. The whole tree takes under a second (128 ms for 2,376 files locally), so filtering to changed files saved nothing, and any filter can drift from what oxfmt formats. With this change, check --fast on #189's failing commit reports docs/guides/develop-a-renderer.md: not formatted (oxfmt).

Test. build.test.ts asserts that the format gate plans npm run --silent format:check for a Markdown change, an .mjs change and no change, with --fast and without, and that the script is oxfmt --check as npm run check runs it. The test fails on the old gate, which skipped the Markdown change with "no formattable file changed".

Also updates the --fast description in AGENTS.md and CONTRIBUTING.md. tools check --fast and tools test tools/cli (155 tests) pass.

…s what CI's would

With --fast or --affected, the format gate checked only changed files whose
extension matched a list that left out Markdown, so a misformatted guide passed
locally and failed CI's `oxfmt --check` (#189). It now runs `npm run
format:check`, CI's own command, in every mode: the whole tree takes under a
second, and a scoped list can only drift from what CI checks. A test asserts
the gate plans that command for a Markdown or .mjs change, scoped or not.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟢 Approval recommended

There are no active review issues blocking the repository-wide formatting gate change.

No open issues 🎉

What changed in this PR

Aligns the tools CLI’s formatting gate with CI so scoped checks no longer miss Markdown or other formatter-supported files.

Changes:

  • Runs npm run --silent format:check across the whole repository in every check mode.
  • Adds regression coverage for Markdown, .mjs, and empty change sets, plus assertions tying the gate to CI’s script.
  • Clarifies that --fast includes whole-repository formatting checks.
File Description
tools/​cli/​test/​build.test.ts Tests format-gate planning and alignment with CI’s script.
tools/​cli/​src/​lib/​gates.ts Replaces changed-file filtering with the root format-check script.
CONTRIBUTING.md Clarifies formatting scope in the recommended check sequence.
AGENTS.md Documents whole-repository formatting under --fast.

Review effort: Balanced

@agorischek
agorischek merged commit c6e3da6 into main Nov 22, 2026
108 of 110 checks passed
@agorischek
agorischek deleted the agorischek/fast-format-parity branch November 22, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants