#!/bin/sh # script/lint: run golangci-lint. The linter is never installed on the # host; it runs only inside Docker, from the pinned image in # Dockerfile.lint, so every run uses the same linter version everywhere. # Linting is a build step there, so a successful build is a clean lint. # # GATE_RUN differs every run so the lint layer always executes; a cached # build would otherwise exit 0 in under a second having linted nothing. # --output=type=cacheonly discards the image and keeps only build cache, # so no tagged image is left behind. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" main() { cd "$ROOT" docker build \ --build-arg GATE_RUN="$(date +%s)-$$" \ --output=type=cacheonly \ -f Dockerfile.lint \ . } main "$@"