From d8285de4cc380052f54a34439444969632c27073 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 7 Nov 2024 19:50:15 +0100 Subject: [PATCH] Add staticcheck in make tests Without this, people like myself will forget to run staticcheck. This fixes it by making it part of make tests, which will run with all the fast tests in CI. Signed-off-by: Jean-Philippe Evrard --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a7dabc9a9..c81b1d31a 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ bootstrap-tools: $(HACKDIR) command -v $(HACKDIR)/cosign || curl -sSfL https://github.com/sigstore/cosign/releases/download/v2.2.3/cosign-linux-amd64 -o $(HACKDIR)/cosign command -v $(HACKDIR)/shellcheck || (curl -sSfL https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz | tar -J -v -x shellcheck-stable/shellcheck && mv shellcheck-stable/shellcheck $(HACKDIR)/shellcheck && rmdir shellcheck-stable) chmod +x $(HACKDIR)/goreleaser $(HACKDIR)/cosign $(HACKDIR)/syft $(HACKDIR)/shellcheck - # go install honnef.co/go/tools/cmd/staticcheck@latest + command -v staticcheck || go install honnef.co/go/tools/cmd/staticcheck@latest clean: rm -rf ./dist @@ -71,4 +71,4 @@ test: bootstrap-tools go test -test.short -json ./... > test.json echo "Running shellcheck" find . -name '*.sh' | xargs -n1 $(HACKDIR)/shellcheck - # Need to add staticcheck to replace golint as golint is deprecated, and staticcheck is the recommendation + staticcheck ./...