diff --git a/Makefile b/Makefile index d7da7f74..4f981948 100644 --- a/Makefile +++ b/Makefile @@ -238,6 +238,10 @@ validate-local: hack/validate-git-marks.sh hack/validate-gofmt.sh $(GOBIN)/golangci-lint run --build-tags "${BUILDTAGS}" + # An extra run with --tests=false allows detecting code unused outside of tests; + # ideally the linter should be able to find this automatically. + # Since everything is already cached, this additional run doesn't take much time. + $(GOBIN)/golangci-lint run --build-tags "${BUILDTAGS}" --tests=false BUILDTAGS="${BUILDTAGS}" hack/validate-vet.sh # This invokes bin/skopeo, hence cannot be run as part of validate-local