Compare commits

..
1 Commits
Author SHA1 Message Date
clawbot 2c8f3827ff Add Makefile shims for cibuild and precommit (closes #34)
check / check (push) Has been cancelled
script/cibuild and script/precommit both existed and were already the
documented CI and pre-commit entrypoints, but neither had a Makefile
target, so the standing rule to drive the repo through make targets
rather than the underlying tool could not be followed for either.

It matters most for the build. A bare `docker build .` fails closed on
the CHECK_EPOCH guard by design, so script/cibuild is one of only three
supported ways to build an image here, and it was the only one of the
three without a target while `make docker` had one.

The two targets are thin shims in the same style as every other target
and change nothing about what the scripts do. .PHONY was already
complete for the targets that existed and now lists both new ones.

README.md's Entrypoints section gains the script-to-target mapping so
the two documents agree, including the two names that do not match:
script/install-precommit is `make hooks`, and script/precommit is
`make precommit`. It also notes that `make cibuild` is the slowest
target, because it is the only one that runs two container builds --
while still taking seconds once the shared script/bootstrap layer is
cached, since Dockerfile.lint's first four instructions are
byte-identical to the main Dockerfile's and the pinned-Hugo compile is
therefore paid once per machine rather than twice.

Two accuracy fixes to text the same section already carried. The
script/install-precommit bullet said the installed hook runs
script/check; the script writes script/precommit into
.git/hooks/pre-commit, and its own header comment says so. And the
Makefile is described as listing the operations you are expected to run
rather than as the authoritative list of everything the repo can do,
which is not literally true: script/projectname is an internal helper
that script/docker calls to compute a tag, and it has no target
deliberately -- a target for it would be noise in the `make<tab>`
listing this change exists to make useful.

TODO.md also loses the stale Future Step asking someone to confirm the
static/_headers file took effect in production. That was confirmed live
on both hostnames on 2026-08-10 and recorded at
#14 , so the item is work
already done.
2026-08-10 13:54:50 +00:00
5 changed files with 21 additions and 29 deletions
+4 -7
View File
@@ -21,11 +21,9 @@
# so calling it from inside would recurse into a docker build with no # so calling it from inside would recurse into a docker build with no
# daemon. # daemon.
# #
# This repo's lint is a Hugo build that fails on any build error and on # This repo's lint is a clean Hugo build that surfaces broken internal
# any Hugo warning. --printPathWarnings makes Hugo warn when two pages # links and template path problems: `hugo` fails on build errors and
# write the same output path, and --panicOnWarning turns that warning, # --printPathWarnings reports render-target collisions.
# and every other one, into a failed build. Only the lint is this strict:
# script/test and the deploy build stay plain `hugo --minify`.
# alpine 3.21, 2026-02-28 # alpine 3.21, 2026-02-28
FROM alpine@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709 FROM alpine@sha256:c3f8e73fdb79deaebaa2037150150191b9dcbfba68b4a46d70103204c53f4709
@@ -60,5 +58,4 @@ COPY . .
# references. # references.
ARG CHECK_EPOCH ARG CHECK_EPOCH
RUN [ -n "$CHECK_EPOCH" ] || exit 1 RUN [ -n "$CHECK_EPOCH" ] || exit 1
RUN echo "lint epoch: ${CHECK_EPOCH}" && \ RUN echo "lint epoch: ${CHECK_EPOCH}" && hugo --minify --printPathWarnings
hugo --minify --printPathWarnings --panicOnWarning
+3 -4
View File
@@ -66,10 +66,9 @@ provide:
git pre-commit hook git pre-commit hook
- `script/test` — the correctness check: a clean `hugo --minify` production - `script/test` — the correctness check: a clean `hugo --minify` production
build build
- `script/lint` — a Hugo build that fails on any Hugo warning, including two - `script/lint` — a clean build that surfaces broken links and path collisions,
pages that write the same output path, run inside Docker: it builds run inside Docker: it builds `Dockerfile.lint`, where the lint is a build
`Dockerfile.lint`, where the lint is a build step, so a successful build is a step, so a successful build is a clean lint
clean lint
- `script/fmt` — format every markdown and CSS file in the repo with prettier; - `script/fmt` — format every markdown and CSS file in the repo with prettier;
the exclusions live in `.prettierignore` with the reason for each the exclusions live in `.prettierignore` with the reason for each
- `script/fmt-check` — check that formatting (read-only) - `script/fmt-check` — check that formatting (read-only)
+6 -9
View File
@@ -20,8 +20,8 @@ wrangler CLI install, an exact version), and the Hugo that builds the published
site is a deliberate pinned version rather than whatever the base image's site is a deliberate pinned version rather than whatever the base image's
package repo serves. The site now ships a Cloudflare Pages `_headers` file, so package repo serves. The site now ships a Cloudflare Pages `_headers` file, so
its response security headers are declared in the repo instead of being whatever its response security headers are declared in the repo instead of being whatever
the edge defaults to, and confirmed live in production on both hostnames. The the edge defaults to — unverified in production until the next deploy. The lint
lint now runs inside a container and nowhere else: `script/lint` is a build of now runs inside a container and nowhere else: `script/lint` is a build of
`Dockerfile.lint`, with no host path to fall back to. Formatting is not a lint `Dockerfile.lint`, with no host path to fall back to. Formatting is not a lint
and stays on the host. Every entrypoint the README documents now has a and stays on the host. Every entrypoint the README documents now has a
`Makefile` target, so the org-wide "use make targets, never the underlying tool" `Makefile` target, so the org-wide "use make targets, never the underlying tool"
@@ -34,13 +34,6 @@ leaning on `.gitignore` (https://git.eeqj.de/sneak/lora.vegas/issues/33).
# Completed Steps # Completed Steps
- 2026-10-21: made `script/lint` fail when two pages write the same output path
(https://git.eeqj.de/sneak/lora.vegas/issues/25). `Dockerfile.lint` now runs
`hugo --minify --printPathWarnings --panicOnWarning`. `--printPathWarnings`
makes Hugo warn about the collision, and `--panicOnWarning` turns that warning
and every other Hugo warning into a failed lint; until now the warning was
printed and the lint still exited 0. `script/test` and the deploy build stay
plain `hugo --minify`
- 2026-08-10: added the `cibuild` and `precommit` targets to the `Makefile` - 2026-08-10: added the `cibuild` and `precommit` targets to the `Makefile`
(https://git.eeqj.de/sneak/lora.vegas/issues/34). Both scripts already (https://git.eeqj.de/sneak/lora.vegas/issues/34). Both scripts already
existed, were already documented, and are the two entrypoints a contributor is existed, were already documented, and are the two entrypoints a contributor is
@@ -335,6 +328,10 @@ outside this repo, so nothing there may be picked up as the Next Step.
## Blocked ## Blocked
- Decide whether `script/lint` should fail on render-target collisions rather
than only print them; `--printPathWarnings` exits 0 today, so the signal is
reported and not enforced. Owner call, since it changes what the gate rejects
(https://git.eeqj.de/sneak/lora.vegas/issues/25)
- Move the artifact actions in `.gitea/workflows/deploy.yml` to v4 once this - Move the artifact actions in `.gitea/workflows/deploy.yml` to v4 once this
Gitea Actions instance serves the v4 artifact protocol; they are pinned on the Gitea Actions instance serves the v4 artifact protocol; they are pinned on the
deprecated v3 line because v4 fails here deprecated v3 line because v4 fails here
+1 -1
View File
@@ -2,7 +2,7 @@
# script/check: run all checks. Our own extension to # script/check: run all checks. Our own extension to
# scripts-to-rule-them-all. Must not modify any tracked files. Runs the # scripts-to-rule-them-all. Must not modify any tracked files. Runs the
# canonical order: the clean production build, then the lint build that # canonical order: the clean production build, then the lint build that
# fails on any Hugo warning, then the read-only formatting check. # reports path warnings, then the read-only formatting check.
# #
# The lint - and only the lint - runs inside Docker: it is a build of # The lint - and only the lint - runs inside Docker: it is a build of
# Dockerfile.lint, so this script needs a working docker daemon and has # Dockerfile.lint, so this script needs a working docker daemon and has
+7 -8
View File
@@ -1,13 +1,12 @@
#!/bin/sh #!/bin/sh
# script/lint: run the lint. This Hugo site has no dedicated linter, so # script/lint: run the lint. This Hugo site has no dedicated linter, so
# the lint is a Hugo build that fails on any build error and on any Hugo # the lint gate is a clean build that surfaces broken internal links and
# warning, including two pages that write the same output path. Where # template path problems -- but where it runs is not negotiable: every
# it runs is not negotiable. Every lint run happens inside a Docker # lint run happens inside a Docker container, so this script does
# container, so this script does nothing except build Dockerfile.lint. # nothing except build Dockerfile.lint. The lint is a build step there,
# The lint is a build step there, so a successful build is a clean lint. # so a successful build is a clean lint. There is deliberately no host
# There is deliberately no host fallback and no "already inside a # fallback and no "already inside a container?" branch: either would be
# container?" branch: either would be a host lint path wearing a # a host lint path wearing a disguise.
# disguise.
# #
# No --target: Dockerfile.lint has exactly one stage, so the whole-file # No --target: Dockerfile.lint has exactly one stage, so the whole-file
# build IS the lint. See that file for why a second, sibling stage would # build IS the lint. See that file for why a second, sibling stage would