#!/bin/sh # script/lint: run the linter. # # The linter runs inside the image built by Dockerfile.lint, and it runs # there as a BUILD STEP: a successful build of that file IS a clean # lint. Nothing lints on the host, at any version, ever. That FROM line # is the single source of truth for the linter version in this repo, so # a local run and a CI run of the same tree cannot disagree. # # One container per run means one lint cache and one golangci-lint lock # per run, both private to that run and thrown away with it. That is # what makes concurrent runs on a shared host safe, and it is why this # script no longer carries per-worktree cache directories, a lock-retry # loop, or an output audit: there is no shared state left for them to # defend (issue https://git.eeqj.de/sneak/vaultik/issues/113). # # To watch the linter execute, set BUILDKIT_PROGRESS=plain, which docker # honours directly: # # BUILDKIT_PROGRESS=plain script/lint # # The lint layer must appear as executing rather than CACHED on every # run; see the CHECK_EPOCH comment in Dockerfile.lint. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" DOCKERFILE="$ROOT/Dockerfile.lint" require_docker() { if ! command -v docker >/dev/null 2>&1; then cat >&2 </dev/null 2>&1; then cat >&2 <&2 <