Repository navigation
tools check: the format gate runs CI's format check, so --fast catches what CI's would - #191
Merged
Merged
Conversation
…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>
There was a problem hiding this comment.
🟢 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:checkacross 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
--fastincludes 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
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.
tools check --fastpassed locally on #189 and #190 while CI'soxfmt --checkfailed. This makes--fastrun the format check CI runs.Cause. With
--fastor--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:docs/guides/develop-a-renderer.md, andcheck --fastpassed. This is the bug.check --fastdoes fail onpackages/renderers/code-statistics/test/statistics.test.mjs, as CI did. The changed-file set includes committed changes (it diffs from the merge base), so that local pass must have been from a run before the file changed, not a gap in the gate.Fix. The format gate runs
npm run format:check(CI's ownoxfmt --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 --faston #189's failing commit reportsdocs/guides/develop-a-renderer.md: not formatted (oxfmt).Test.
build.test.tsasserts that the format gate plansnpm run --silent format:checkfor a Markdown change, an.mjschange and no change, with--fastand without, and that the script isoxfmt --checkasnpm run checkruns it. The test fails on the old gate, which skipped the Markdown change with "no formattable file changed".Also updates the
--fastdescription in AGENTS.md and CONTRIBUTING.md.tools check --fastandtools test tools/cli(155 tests) pass.