fmt: format and check Markdown with prettier in a container (closes #119)
check / check (push) Failing after 2m11s

make fmt and make fmt-check now cover every Markdown file with prettier
(4-space tabs, proseWrap always), as template-app-go does: prettier is
pinned by package.json and yarn.lock and runs in a docker build on a
digest-pinned node image, never on the host. The check is forced to run
with --no-cache-filter, as script/lint is.

script/fmt-check is split into a Go half and a Markdown half because the
Dockerfile lint stage cannot run docker: that stage now runs the Go half
and script/cibuild runs the Markdown half after the build. *.md leaves
.dockerignore so documents reach the build context.

README.md, TESTING.md and TODO.md are reformatted by make fmt; apart from
the README Entrypoints entries, its make fmt line under Building and the
TODO entry, that diff is mechanical.

Model: opus-5-5
This commit was merged in pull request #196.
This commit is contained in:
2026-10-02 00:19:30 +02:00
parent b5814b2451
commit 4c2932d6d6
17 changed files with 602 additions and 417 deletions
+8 -6
View File
@@ -3,11 +3,12 @@
# this repo. Idempotent: every install is guarded by a check so already
# installed tools are skipped. Base tooling comes from nix, apt, brew,
# or apk (detected in that order); assumes nothing is present.
# goimports is not installed here: script/fmt and script/fmt-check run
# it with `go run` at a pinned commit.
# goimports is not installed here: script/fmt and script/fmt-check-go
# run it with `go run` at a pinned commit.
# The linter is NOT installed here: golangci-lint runs via docker only
# (script/lint), pinned by image digest, so its only prerequisite is a
# working docker.
# working docker. Nor is prettier: script/fmt and
# script/fmt-check-markdown run it in a container from Dockerfile.fmt.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
@@ -66,11 +67,12 @@ main() {
if missing make; then pkg_install gnumake make make make; fi
if missing go; then pkg_install go golang go go; fi
# Linting runs via docker only (script/lint). Warn, don't fail:
# everything except `make lint` works without it.
# Linting and the markdown formatter run via docker only. Warn,
# don't fail: building and testing work without it.
if missing docker; then
echo "bootstrap: WARNING: docker not found; install it to" \
"run make lint and make docker." >&2
"run make lint, make fmt, make fmt-check, make check" \
"and make docker." >&2
fi
go mod download