#!/bin/sh
# script/lint: run the linter. golangci-lint is never installed locally:
# it runs via docker only, one way, everywhere — script/lint builds
# Dockerfile.lint, which COPYs the repo into the pinned golangci-lint
# image and lints as a build step. This works even when the docker daemon
# is remote and bind mounts are impossible.
#
# --no-cache-filter=lint forces the lint stage to re-execute every run, so
# an unchanged tree is still actually linted; the deps stage keeps its
# cache, so the module download is not repeated.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

main() {
    cd "$ROOT"
    docker build --no-cache-filter=lint -f Dockerfile.lint .
}

main "$@"
