Files
simplelog/script/lint
T
sneak da79c587c0
check / check (push) Successful in 38s
check / check (pull_request) Successful in 38s
Run the linter only in Docker (closes #20)
script/lint now builds only the lint stage of the Dockerfile, without
the build cache, so every run executes the linter; the image is tagged
simplelog-lint. The lint stage calls golangci-lint directly, since make
lint is itself a docker build of that stage. script/cibuild and
script/docker also build without the cache, so their check steps always
run. script/fmt no longer runs golangci-lint --fix, and script/bootstrap
no longer installs it. golangci-lint config verify is left out, on the
owner's ruling. The README, TODO.md and the script/cibuild comment say
what now runs.

Model: opus-5-5
2026-10-06 04:34:31 +00:00

20 lines
603 B
Bash
Executable File

#!/bin/sh
# script/lint: run the linter, in docker only, by building the lint stage
# of the Dockerfile and nothing else; the build fails on any finding.
# --no-cache makes every run execute the linter: a cached build of an
# unchanged tree succeeds without linting anything. The tag makes each
# build replace the previous image instead of leaving an untagged one.
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
main() {
cd "$ROOT"
docker build --no-cache \
--target lint \
-t "$("$SCRIPT_DIR/projectname")-lint" .
}
main "$@"