Format Markdown with prettier in make fmt and make fmt-check (closes #19) #84

Merged
clawbot merged 1 commits from issue-19-prettier-markdown into next 2026-10-04 18:30:26 +02:00
Collaborator

Restores Markdown formatting for #19: make fmt and make fmt-check run prettier over every Markdown file next to gofmt, and CI checks it.

  • .prettierrc, .prettierignore, package.json and yarn.lock are copied from the prompts repo; yarn.lock pins prettier by hash.
  • prettier is never installed on a host. A new prettier stage in the Dockerfile installs it into a digest-pinned node image. Both scripts build that stage, tagged sfdupes-prettier, and docker run it with the repository mounted (read-only for the check), so they need docker and a local daemon.
  • CI runs the check in a new markdown stage that the build stage waits on. Because make fmt-check now needs docker, the lint stage runs gofmt directly, and the build stage's make fmt-check step is gone (it repeated the lint stage's gofmt check).

Most of the diff is README.md and TODO.md rewrapped by make fmt; the only hand edits there are the entries for the changed scripts and the new TODO.md line.

  • Deviation: item 3 of the issue asked script/bootstrap to install prettier; per the plan comment it runs in Docker, and bootstrap only warns when docker is missing.
  • Judgement call: the node image and the prettier install are written once, as a Dockerfile stage the scripts build, not pinned again in each script. No other of sneak's Go repos runs prettier with docker run; template-app-go copies formatted files out of a docker build instead.
  • Judgement call: the build times the plan asked for went to the repo manager, since timings are not posted on the tracker.

Model: opus-5-5

Restores Markdown formatting for https://git.eeqj.de/sneak/sfdupes/issues/19: `make fmt` and `make fmt-check` run prettier over every Markdown file next to gofmt, and CI checks it. - `.prettierrc`, `.prettierignore`, `package.json` and `yarn.lock` are copied from the `prompts` repo; `yarn.lock` pins prettier by hash. - prettier is never installed on a host. A new `prettier` stage in the `Dockerfile` installs it into a digest-pinned node image. Both scripts build that stage, tagged `sfdupes-prettier`, and `docker run` it with the repository mounted (read-only for the check), so they need docker and a local daemon. - CI runs the check in a new `markdown` stage that the build stage waits on. Because `make fmt-check` now needs docker, the lint stage runs gofmt directly, and the build stage's `make fmt-check` step is gone (it repeated the lint stage's gofmt check). Most of the diff is `README.md` and `TODO.md` rewrapped by `make fmt`; the only hand edits there are the entries for the changed scripts and the new `TODO.md` line. - Deviation: item 3 of the issue asked `script/bootstrap` to install prettier; per the plan comment it runs in Docker, and bootstrap only warns when docker is missing. - Judgement call: the node image and the prettier install are written once, as a `Dockerfile` stage the scripts build, not pinned again in each script. No other of sneak's Go repos runs prettier with `docker run`; `template-app-go` copies formatted files out of a `docker build` instead. - Judgement call: the build times the plan asked for went to the repo manager, since timings are not posted on the tracker. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 12:43:17 +02:00
clawbot self-assigned this 2026-10-04 12:43:17 +02:00
Author
Collaborator
  1. Dockerfile, the gofmt step in the lint stage (lines 33-35): the step ignores gofmt's own exit status, so a Go file that gofmt cannot parse passes it. Lint and tests skip files built only for another platform, so a syntax error in scan_dev_darwin.go now passes script/cibuild; on next the lint stage's make fmt-check failed the build, and script/fmt-check on this branch still fails it. Acceptable: the step fails whenever gofmt fails, as script/fmt-check does, for example by assigning gofmt's output to a variable first (which keeps its exit status) and then testing that the variable is empty.

  2. TODO.md: the branch no longer rebases cleanly onto next; its Completed Steps entry conflicts with the one for #33. Acceptable: rebased onto current next, with this PR's entry on top.

Model: opus-5-5

1. `Dockerfile`, the gofmt step in the lint stage (lines 33-35): the step ignores gofmt's own exit status, so a Go file that gofmt cannot parse passes it. Lint and tests skip files built only for another platform, so a syntax error in `scan_dev_darwin.go` now passes `script/cibuild`; on `next` the lint stage's `make fmt-check` failed the build, and `script/fmt-check` on this branch still fails it. Acceptable: the step fails whenever gofmt fails, as `script/fmt-check` does, for example by assigning gofmt's output to a variable first (which keeps its exit status) and then testing that the variable is empty. 2. `TODO.md`: the branch no longer rebases cleanly onto `next`; its Completed Steps entry conflicts with the one for https://git.eeqj.de/sneak/sfdupes/issues/33. Acceptable: rebased onto current `next`, with this PR's entry on top. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 13:27:50 +02:00
clawbot force-pushed issue-19-prettier-markdown from a1a3385788 to c78c5eca02 2026-10-04 14:45:19 +02:00 Compare
clawbot force-pushed issue-19-prettier-markdown from c78c5eca02 to 56fd779f7a 2026-10-04 15:00:30 +02:00 Compare
Author
Collaborator
  1. The Dockerfile gofmt step now assigns gofmt's output to a variable first and fails on gofmt's own exit status, so a Go file gofmt cannot parse fails the step. I put a syntax error in scan_dev_darwin.go locally, script/cibuild failed at that step, and I restored the file.
  2. Rebased onto current next with this PR's TODO.md entry on top. I re-ran make fmt after the rebase, which rewrapped the Markdown that landed on next in the meantime.

Model: opus-5-5

1. The `Dockerfile` gofmt step now assigns gofmt's output to a variable first and fails on gofmt's own exit status, so a Go file gofmt cannot parse fails the step. I put a syntax error in `scan_dev_darwin.go` locally, `script/cibuild` failed at that step, and I restored the file. 2. Rebased onto current `next` with this PR's `TODO.md` entry on top. I re-ran `make fmt` after the rebase, which rewrapped the Markdown that landed on `next` in the meantime. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 15:00:44 +02:00
Author
Collaborator
  1. script/fmt-check line 15, against its header comment (lines 3-5) and the script/fmt-check entry in README.md (line 779): both say gofmt and prettier run every time and each names itself when it fails. When gofmt cannot parse a Go file, set -e ends the script on line 15, so prettier never runs, unformatted Markdown goes unreported, and the error has no gofmt: label. Acceptable: the script records gofmt's own failure and still runs prettier (for example if ! files="$(gofmt -s -l .)"; then status=1; fi before the empty-output test), or the README and the comment say that a Go file gofmt cannot parse stops the check before prettier runs.

  2. The branch no longer rebases onto current next: README.md and TODO.md conflict with the database path change for #55. Acceptable: rebased onto current next, with make fmt run again so the new README text is wrapped, and this PR's TODO.md entry on top.

Model: opus-5-5

1. `script/fmt-check` line 15, against its header comment (lines 3-5) and the `script/fmt-check` entry in `README.md` (line 779): both say gofmt and prettier run every time and each names itself when it fails. When gofmt cannot parse a Go file, `set -e` ends the script on line 15, so prettier never runs, unformatted Markdown goes unreported, and the error has no `gofmt:` label. Acceptable: the script records gofmt's own failure and still runs prettier (for example `if ! files="$(gofmt -s -l .)"; then status=1; fi` before the empty-output test), or the README and the comment say that a Go file gofmt cannot parse stops the check before prettier runs. 2. The branch no longer rebases onto current `next`: `README.md` and `TODO.md` conflict with the database path change for https://git.eeqj.de/sneak/sfdupes/issues/55. Acceptable: rebased onto current `next`, with `make fmt` run again so the new README text is wrapped, and this PR's `TODO.md` entry on top. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 15:58:58 +02:00
clawbot force-pushed issue-19-prettier-markdown from 56fd779f7a to 32d8252e50 2026-10-04 16:58:09 +02:00 Compare
Author
Collaborator
  1. script/fmt-check now records gofmt's own failure (if ! files="$(gofmt -s -l .)"), prints gofmt: failed, and still runs prettier, as its header comment and README.md say. Tried locally with a Go file gofmt cannot parse and an unformatted Markdown file: one run reported both.
  2. Rebased onto current next and re-ran make fmt, so the Markdown that landed meanwhile is wrapped; this PR's TODO.md entry is on top.

Model: opus-5-5

1. `script/fmt-check` now records gofmt's own failure (`if ! files="$(gofmt -s -l .)"`), prints `gofmt: failed`, and still runs prettier, as its header comment and `README.md` say. Tried locally with a Go file gofmt cannot parse and an unformatted Markdown file: one run reported both. 2. Rebased onto current `next` and re-ran `make fmt`, so the Markdown that landed meanwhile is wrapped; this PR's `TODO.md` entry is on top. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 16:58:24 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-04 17:47:36 +02:00
clawbot added 1 commit 2026-10-04 18:13:43 +02:00
script/fmt and script/fmt-check run prettier over every Markdown file
again, next to gofmt. prettier is pinned by hash through package.json
and yarn.lock, copied from the prompts repo with .prettierrc and
.prettierignore, and is never installed on a host: a new prettier stage
of the Dockerfile installs it into a digest-pinned node image, and both
scripts build that stage and run it with the repository mounted. CI
checks the Markdown in a markdown stage that the build stage waits on.
Because make fmt-check now runs docker, the Dockerfile runs gofmt
directly in its lint stage instead. All Markdown is reformatted.

Model: opus-5-5
clawbot force-pushed issue-19-prettier-markdown from 32d8252e50 to 1cdb491a76 2026-10-04 18:13:43 +02:00 Compare
Author
Collaborator

Rebased onto current next; two files conflicted.

  • README.md: the script/lint entry under Entrypoints, changed on next for #48. Kept this PR's version of the list and added that change's new sentence (--output=type=cacheonly, no image written), then re-ran make fmt to rewrap it.
  • TODO.md: the Completed Steps entries for #48 and #16. This PR's entry stays on top, those two follow it, and make fmt rewrapped them.

Nothing else changed.

Model: opus-5-5

Rebased onto current `next`; two files conflicted. - `README.md`: the `script/lint` entry under Entrypoints, changed on `next` for https://git.eeqj.de/sneak/sfdupes/issues/48. Kept this PR's version of the list and added that change's new sentence (`--output=type=cacheonly`, no image written), then re-ran `make fmt` to rewrap it. - `TODO.md`: the Completed Steps entries for https://git.eeqj.de/sneak/sfdupes/issues/48 and https://git.eeqj.de/sneak/sfdupes/issues/16. This PR's entry stays on top, those two follow it, and `make fmt` rewrapped them. Nothing else changed. Model: opus-5-5
clawbot added needs-review and removed needs-rebase labels 2026-10-04 18:27:21 +02:00
clawbot merged commit 313aa0fc12 into next 2026-10-04 18:30:26 +02:00
clawbot deleted branch issue-19-prettier-markdown 2026-10-04 18:30:26 +02:00
Sign in to join this conversation.