fmt: format and check Markdown with prettier in a container (closes #119)
check / check (push) Failing after 2m11s
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:
+9
-4
@@ -1,18 +1,23 @@
|
||||
#!/bin/sh
|
||||
# script/cibuild: run the CI build. The Dockerfile's lint stage runs
|
||||
# make fmt-check and golangci-lint; its builder stage runs make test
|
||||
# and make build.
|
||||
# the Go half of make fmt-check and golangci-lint; its builder stage
|
||||
# runs make test and make build. The markdown half of make fmt-check
|
||||
# runs after that build, as its own build of Dockerfile.fmt, because
|
||||
# there is no docker inside a docker build.
|
||||
#
|
||||
# --no-cache-filter=lint,builder runs both stages on every invocation;
|
||||
# otherwise an unchanged tree is served from the layer cache and passes
|
||||
# without linting or querying live DNS.
|
||||
# without linting or querying live DNS. script/fmt-check-markdown busts
|
||||
# its own cache the same way.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
docker build --no-cache-filter=lint,builder .
|
||||
"$SCRIPT_DIR/fmt-check-markdown"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user