build: run all linting in Docker via Dockerfile.lint (closes #104)
check / check (push) Successful in 2m36s
check / check (push) Successful in 2m36s
golangci-lint now runs only inside a container, never on the host. script/lint builds a hash-pinned root Dockerfile.lint; the nix-shell and host golangci-lint paths are gone. A per-run CACHEBUST build-arg is folded into the lint step's cache key, so the linter re-executes on every run and an unchanged tree cannot return a cached success having linted nothing; script/lint fails a build that did not run the linter. Dockerfile's lint stage runs golangci-lint directly, since make lint now builds a container and there is no Docker inside a build. It is the same image and config. golangci-lint config verify is left out: it fetches its schema over an unpinned live HTTPS call, which REPO_POLICIES.md forbids. Model: opus-4-8
This commit is contained in:
+5
-2
@@ -13,9 +13,12 @@ RUN go mod download
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Run formatting check and linter
|
||||
# Run formatting check and linter. The linter is invoked directly, not
|
||||
# via `make lint`: `make lint` now builds Dockerfile.lint, and there is
|
||||
# no Docker inside a Docker build. This is the same linter, image, and
|
||||
# config that Dockerfile.lint and script/lint run.
|
||||
RUN make fmt-check
|
||||
RUN make lint
|
||||
RUN golangci-lint run --config .golangci.yml ./...
|
||||
|
||||
# Build stage
|
||||
# golang:1.25.4-alpine, 2026-02-25
|
||||
|
||||
Reference in New Issue
Block a user