Skip to content

ci(apps): run format:check on whole repo for PR/main parity#40

Open
jdwillmsen wants to merge 3 commits into
mainfrom
fix/JDWLABS-63-ci-format-parity
Open

ci(apps): run format:check on whole repo for PR/main parity#40
jdwillmsen wants to merge 3 commits into
mainfrom
fix/JDWLABS-63-ci-format-parity

Conversation

@jdwillmsen

Copy link
Copy Markdown
Member

Problem (JDWLABS-63)

nx format:check defaults to affected scope, so the format gate's coverage tracks git context — the PR diff on pull_request, the push range on main-push. A repo-wide formatting violation in a file the change doesn't touch therefore passes every PR yet fails on main-push: a green PR did not imply a green main.

Verified locally: with an empty affected range, nx format:check exits 0 while nx format:check --all exits 1 and flags the offenders.

Change

  • ci.yml: nx format:checknx format:check --all. The gate now checks the entire repo on every event, so a green PR guarantees a green main for formatting. lint/test/build stay on nx affected (expensive, cacheable, project-scoped); whole-repo format is sub-second, so there's no reason to scope it.
  • repo docs: 13 README/CONTRIBUTING files had drifted out of prettier compliance under affected-only scoping (never re-checked). Reformatted so --all is green.
  • .prettierignore: added LICENSE.md — canonical third-party license text that prettier would otherwise rewrite.

Verification

pnpm exec nx format:check --all → exit 0 on this branch.

Follow-up (not in this PR)

The ticket's second bullet — requiring the format status check in branch protection so an admin override isn't the path of least resistance — is a GitHub ruleset change, tracked separately (org governance, JDWLABS-14).

🤖 Generated with Claude Code

jdwillmsen and others added 3 commits July 4, 2026 00:46
These files predate the format:check --all gate and were never re-checked
under affected-only scoping, so they drifted out of prettier compliance on
main. Reformat them so the whole-repo gate passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-by: Claude:Opus-4.8
LICENSE.md is verbatim third-party license text (PolyForm). Prettier would
rewrite its whitespace and emphasis markers; exclude it so format:check --all
does not flag or mutate canonical legal text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-by: Claude:Opus-4.8
nx format:check defaults to affected scope, so its coverage tracks git context
(PR diff on pull_request, push range on main). A formatting violation in a file
the change does not touch passes the PR gate but fails the main-push gate — a
green PR did not imply a green main (JDWLABS-63). Add --all so the format gate
checks the entire repo on every event.

Formatting is a whole-repo invariant, not a per-project task; unlike lint/test/
build (kept on nx affected for cache/time), format:check over the repo is
sub-second, so there is no reason to scope it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-by: Claude:Opus-4.8
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.

1 participant