make fmt does not format Markdown, so the org prettier settings are unenforced here #215

Closed
opened 2026-08-20 06:05:22 +02:00 by clawbot · 2 comments
Collaborator

Found while landing #210.

script/fmt is gofmt -s -w . plus goimports, and there is no prettier config anywhere in the tree. Org policy is that Markdown changes are formatted with the repo's own settings (prettier, 4-space tabs, proseWrap: always) and that unformatted Markdown is never committed — but nothing in this repo enforces that.

The practical effect: make fmt and make fmt-check both pass on any Markdown, however it is wrapped. They pass vacuously. The 162-line README section added by #210 was hand-wrapped to the file's existing 72-column width and checked by eye, which is exactly the manual step the formatter is supposed to remove.

Definition of done:

  • a prettier config in the tree matching the org settings (4-space tabs, proseWrap: always)
  • script/fmt formats Markdown as well as Go; script/fmt-check fails on unformatted Markdown
  • prettier is pinned and runs in Docker like the other linting, not off whatever is on the host
  • the existing Markdown in the tree is reformatted in the same commit, so the check starts green
  • confirm the resulting wrap width does not reflow every existing file into a large unrelated diff; if it does, say so on this issue before committing it
Found while landing https://git.eeqj.de/sneak/webhooker/issues/210. `script/fmt` is `gofmt -s -w .` plus `goimports`, and there is no prettier config anywhere in the tree. Org policy is that Markdown changes are formatted with the repo's own settings (prettier, 4-space tabs, `proseWrap: always`) and that unformatted Markdown is never committed — but nothing in this repo enforces that. The practical effect: `make fmt` and `make fmt-check` both pass on any Markdown, however it is wrapped. They pass vacuously. The 162-line README section added by https://git.eeqj.de/sneak/webhooker/issues/210 was hand-wrapped to the file's existing 72-column width and checked by eye, which is exactly the manual step the formatter is supposed to remove. Definition of done: - a prettier config in the tree matching the org settings (4-space tabs, `proseWrap: always`) - `script/fmt` formats Markdown as well as Go; `script/fmt-check` fails on unformatted Markdown - prettier is pinned and runs in Docker like the other linting, not off whatever is on the host - the existing Markdown in the tree is reformatted in the same commit, so the check starts green - confirm the resulting wrap width does not reflow every existing file into a large unrelated diff; if it does, say so on this issue before committing it
Author
Collaborator

Plan.

  • Settings: a prettier config in the tree with the org settings (tabWidth: 4, proseWrap: always, defaults otherwise), applied to Markdown only; vendored files under 3p/ are left alone.
  • Pinned, in Docker: prettier is pinned in the existing package.json and yarn.lock beside ESLint and runs from the same cached install stage (#486), never from the host. script/fmt-check runs prettier --check in a stage and fails on unformatted Markdown. script/fmt gets the formatted files back without a bind mount (the daemon may be remote), for example through docker build --output.
  • Reformat: every Markdown file in the tree is reformatted in the same change, so the check starts green. The README is wrapped at 72 columns today and prettier wraps at 80, so it reflows nearly every paragraph. That diff is expected and accepted: it is mechanical, and the org settings are the standard. The PR says the reformat changed no words; the reviewer checks that with a word diff. If prettier changes a policy file copied from another repo (such as REPO_POLICIES.md), the PR says which.
  • Lands after #490, the one open PR that touches the README, or rebases over it.

Model: opus-5-5

Plan. - **Settings:** a prettier config in the tree with the org settings (`tabWidth: 4`, `proseWrap: always`, defaults otherwise), applied to Markdown only; vendored files under `3p/` are left alone. - **Pinned, in Docker:** prettier is pinned in the existing `package.json` and `yarn.lock` beside ESLint and runs from the same cached install stage (https://git.eeqj.de/sneak/webhooker/pulls/486), never from the host. `script/fmt-check` runs `prettier --check` in a stage and fails on unformatted Markdown. `script/fmt` gets the formatted files back without a bind mount (the daemon may be remote), for example through `docker build --output`. - **Reformat:** every Markdown file in the tree is reformatted in the same change, so the check starts green. The README is wrapped at 72 columns today and prettier wraps at 80, so it reflows nearly every paragraph. That diff is expected and accepted: it is mechanical, and the org settings are the standard. The PR says the reformat changed no words; the reviewer checks that with a word diff. If prettier changes a policy file copied from another repo (such as `REPO_POLICIES.md`), the PR says which. - Lands after https://git.eeqj.de/sneak/webhooker/pulls/490, the one open PR that touches the README, or rebases over it. Model: opus-5-5
Author
Collaborator

Implemented in #492.

make fmt now formats the Markdown with prettier as well as the Go, and make fmt-check (so also make check and the image build) fails on unformatted Markdown. prettier is pinned in package.json and yarn.lock, reads .prettierrc (4-space tabs, proseWrap: always), and runs only in Docker. The second commit reformats README.md and TODO.md; REPO_POLICIES.md was already formatted.

  • A word diff ignoring whitespace shows no word changed: only table padding, * list markers becoming - and *emphasis* becoming _emphasis_; code blocks are byte-identical.
  • An unformatted README paragraph turned make fmt-check and make check red, and make fmt fixed it.
  • Judgement call: the Dockerfile lint stage runs the gofmt check directly instead of make fmt-check, which now needs a docker daemon.
  • Deviation: TODO.md, normally left to the manager, is reformatted (no words changed) so the check starts green.

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/webhooker/pulls/492. `make fmt` now formats the Markdown with prettier as well as the Go, and `make fmt-check` (so also `make check` and the image build) fails on unformatted Markdown. prettier is pinned in `package.json` and `yarn.lock`, reads `.prettierrc` (4-space tabs, `proseWrap: always`), and runs only in Docker. The second commit reformats `README.md` and `TODO.md`; `REPO_POLICIES.md` was already formatted. - A word diff ignoring whitespace shows no word changed: only table padding, `*` list markers becoming `-` and `*emphasis*` becoming `_emphasis_`; code blocks are byte-identical. - An unformatted README paragraph turned `make fmt-check` and `make check` red, and `make fmt` fixed it. - Judgement call: the `Dockerfile` lint stage runs the `gofmt` check directly instead of `make fmt-check`, which now needs a docker daemon. - Deviation: `TODO.md`, normally left to the manager, is reformatted (no words changed) so the check starts green. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#215