fix: make fmt refuses to run without the repo's own prettier (closes #509) #538

Open
clawbot wants to merge 1 commits from issue-509-fmt-require-bootstrap into next
Collaborator

Implements #509.

script/fmt and script/fmt-check now stop before running yarn when node_modules/.bin/prettier is missing, and print a sentence telling the user to run script/bootstrap. Without that file, yarn run fmt falls back to whatever prettier is on the PATH. That can be a different version from the one yarn.lock pins, and it rewrites files the pinned one leaves alone: the host's 3.9.6 against the pinned 3.8.1 flags script/lib/icons.js. After script/bootstrap both scripts behave as before. The README Entrypoints entries for the two scripts say so.

What the diff does not show:

  • node_modules/.bin is the directory yarn run puts first on the PATH, so the check covers exactly the case where yarn would fall back. -x follows the link, so a link left behind after node_modules/prettier was deleted also counts as missing.
  • script/cibuild already runs script/bootstrap before script/check, so CI and the pre-commit hook in a bootstrapped clone are unaffected. The Dockerfile's lint phase calls prettier itself and does not go through these scripts.

Judgement call: the check is for presence only. A node_modules/ left over from an older yarn.lock still runs whatever prettier it holds.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/AutistMask/issues/509. `script/fmt` and `script/fmt-check` now stop before running yarn when `node_modules/.bin/prettier` is missing, and print a sentence telling the user to run `script/bootstrap`. Without that file, `yarn run fmt` falls back to whatever `prettier` is on the `PATH`. That can be a different version from the one `yarn.lock` pins, and it rewrites files the pinned one leaves alone: the host's 3.9.6 against the pinned 3.8.1 flags `script/lib/icons.js`. After `script/bootstrap` both scripts behave as before. The README Entrypoints entries for the two scripts say so. What the diff does not show: - `node_modules/.bin` is the directory `yarn run` puts first on the `PATH`, so the check covers exactly the case where yarn would fall back. `-x` follows the link, so a link left behind after `node_modules/prettier` was deleted also counts as missing. - `script/cibuild` already runs `script/bootstrap` before `script/check`, so CI and the pre-commit hook in a bootstrapped clone are unaffected. The Dockerfile's lint phase calls `prettier` itself and does not go through these scripts. Judgement call: the check is for presence only. A `node_modules/` left over from an older `yarn.lock` still runs whatever prettier it holds. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 06:11:21 +02:00
clawbot self-assigned this 2026-10-14 06:11:21 +02:00
clawbot added 1 commit 2026-10-14 06:11:22 +02:00
fix: make fmt refuses to run without the repo's own prettier (closes #509)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
094ce4113b
In a clone where script/bootstrap has not run, node_modules/ is empty and
yarn falls back to whatever prettier is on the PATH, which can format files
differently from the version yarn.lock pins. script/fmt and script/fmt-check
now stop with a message telling the user to run script/bootstrap when
node_modules/.bin/prettier is missing. After bootstrap they behave as
before. The README Entrypoints entries say so.

Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-509-fmt-require-bootstrap:issue-509-fmt-require-bootstrap
git checkout issue-509-fmt-require-bootstrap
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#538