script/fmt and script/fmt-check dropped Markdown formatting #19

Closed
opened 2026-08-09 03:46:42 +02:00 by clawbot · 2 comments
Collaborator

The canonical scripts-to-rule-them-all templates in the prompts repo run prettier over Markdown:

  • script/fmt: yarn run prettier --write '**/*.md' --tab-width 4 --prose-wrap always
  • script/fmt-check: the same with --check

sfdupes replaced both bodies with gofmt only (script/fmt:9 is gofmt -s -w .; script/fmt-check:10-15 is gofmt -s -l .). Markdown formatting was dropped entirely rather than added alongside the Go formatting, and there is no .prettierrc or .prettierignore in the repo.

Consequences: make fmt cannot format this repo's Markdown, make fmt-check cannot catch unformatted Markdown, and make check passes on a README that violates the house 4-space / proseWrap: always / 80-column settings. Every Markdown change in this repo — and there are many, since the README is the authoritative specification — is currently unformatted by policy standards and nothing detects it.

Definition of done

  1. .prettierrc and .prettierignore are copied verbatim from the prompts repo root (.prettierrc sha256 1a709149f32ac4adf4004017cf30d8f5482ccf263f414081ae8c499037691133, .prettierignore sha256 dbe0186431d09e741fe0ccddf3ac97451575ab88f94fe89353dc2e3ecb83d64b).
  2. script/fmt runs gofmt and prettier over Markdown; script/fmt-check checks both, reporting each independently so it is clear which failed.
  3. script/bootstrap installs prettier, pinned by hash per REPO_POLICIES — no curl | bash, no floating tag. Note the canonical template invokes it via yarn; decide and document how it is obtained here given this is a Go repo with no package.json, and keep the pinning rule intact.
  4. The Dockerfile lint stage can still run make fmt-check, or the Markdown check is placed where CI genuinely runs it — do not let the check exist only on developer machines.
  5. All existing Markdown in the repo is reformatted to comply, in this same commit.
  6. make check green (including the new Markdown check) and make docker succeeds.
The canonical scripts-to-rule-them-all templates in the `prompts` repo run prettier over Markdown: - `script/fmt`: `yarn run prettier --write '**/*.md' --tab-width 4 --prose-wrap always` - `script/fmt-check`: the same with `--check` sfdupes replaced both bodies with gofmt only (`script/fmt:9` is `gofmt -s -w .`; `script/fmt-check:10-15` is `gofmt -s -l .`). Markdown formatting was dropped entirely rather than added alongside the Go formatting, and there is no `.prettierrc` or `.prettierignore` in the repo. Consequences: `make fmt` cannot format this repo's Markdown, `make fmt-check` cannot catch unformatted Markdown, and `make check` passes on a README that violates the house 4-space / `proseWrap: always` / 80-column settings. Every Markdown change in this repo — and there are many, since the README is the authoritative specification — is currently unformatted by policy standards and nothing detects it. ## Definition of done 1. `.prettierrc` and `.prettierignore` are copied verbatim from the `prompts` repo root (`.prettierrc` sha256 `1a709149f32ac4adf4004017cf30d8f5482ccf263f414081ae8c499037691133`, `.prettierignore` sha256 `dbe0186431d09e741fe0ccddf3ac97451575ab88f94fe89353dc2e3ecb83d64b`). 2. `script/fmt` runs gofmt **and** prettier over Markdown; `script/fmt-check` checks both, reporting each independently so it is clear which failed. 3. `script/bootstrap` installs prettier, pinned by hash per REPO_POLICIES — no `curl | bash`, no floating tag. Note the canonical template invokes it via `yarn`; decide and document how it is obtained here given this is a Go repo with no `package.json`, and keep the pinning rule intact. 4. The Dockerfile lint stage can still run `make fmt-check`, or the Markdown check is placed where CI genuinely runs it — do not let the check exist only on developer machines. 5. All existing Markdown in the repo is reformatted to comply, in this same commit. 6. `make check` green (including the new Markdown check) and `make docker` succeeds.
clawbot added this to the 1.0.0 milestone 2026-08-09 03:46:42 +02:00
Author
Collaborator

Plan (implementer's brief). The pushed branch issue-19-markdown-fmt is stale (written before the containerised lint and the build-stage changes); start fresh from next and reuse from it only what still fits.

  • Same rule as the linter (#46): prettier runs in a container, never installed on the host. script/fmt and script/fmt-check run it through docker run of a digest-pinned node image with the repo mounted, the way script/lint runs the linter; gofmt stays as it is. Prettier itself is pinned by hash through package.json and yarn.lock (yarn install --frozen-lockfile inside the container), per REPO_POLICIES.md. If another of sneak's Go repos already formats Markdown this way, follow it and name it in the PR.
  • Item 4: CI must run the Markdown check. A docker build cannot run docker, so the check goes in its own Dockerfile stage on the same pinned node image, ordered like the lint stage; keep the existing gate layers and CHECK_EPOCH behaviour, and keep the build-time gains from #43.
  • .prettierrc and .prettierignore verbatim from the prompts repo (item 1 hashes).
  • Item 5: reformat all Markdown in the same commit with make fmt; no hand edits to the reformatted text.
  • Wrap each Docker build in timeout -s INT 900 inside flock -w 3600 /srv/code/tmp/docker-gate.lock; remove images and containers you create. PR body: a cold and a warm script/cibuild time, one line each.

Model: opus-5-5

Plan (implementer's brief). The pushed branch `issue-19-markdown-fmt` is stale (written before the containerised lint and the build-stage changes); start fresh from `next` and reuse from it only what still fits. - Same rule as the linter (https://git.eeqj.de/sneak/sfdupes/issues/46): prettier runs in a container, never installed on the host. `script/fmt` and `script/fmt-check` run it through `docker run` of a digest-pinned node image with the repo mounted, the way `script/lint` runs the linter; `gofmt` stays as it is. Prettier itself is pinned by hash through `package.json` and `yarn.lock` (`yarn install --frozen-lockfile` inside the container), per `REPO_POLICIES.md`. If another of sneak's Go repos already formats Markdown this way, follow it and name it in the PR. - Item 4: CI must run the Markdown check. A `docker build` cannot run `docker`, so the check goes in its own `Dockerfile` stage on the same pinned node image, ordered like the lint stage; keep the existing gate layers and `CHECK_EPOCH` behaviour, and keep the build-time gains from https://git.eeqj.de/sneak/sfdupes/issues/43. - `.prettierrc` and `.prettierignore` verbatim from the `prompts` repo (item 1 hashes). - Item 5: reformat all Markdown in the same commit with `make fmt`; no hand edits to the reformatted text. - Wrap each Docker build in `timeout -s INT 900` inside `flock -w 3600 /srv/code/tmp/docker-gate.lock`; remove images and containers you create. PR body: a cold and a warm `script/cibuild` time, one line each. Model: opus-5-5
clawbot self-assigned this 2026-10-04 10:01:51 +02:00
Author
Collaborator

Implemented in #84: prettier runs in Docker from a new Dockerfile stage, for make fmt, make fmt-check and CI alike, and all Markdown is reformatted.

Model: opus-5-5

Implemented in https://git.eeqj.de/sneak/sfdupes/pulls/84: prettier runs in Docker from a new `Dockerfile` stage, for `make fmt`, `make fmt-check` and CI alike, and all Markdown is reformatted. Model: opus-5-5
Sign in to join this conversation.