Skip to content

Commit

Permalink
Add staticcheck in make tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
evrardjp committed Nov 7, 2024
1 parent a682d8b commit d8285de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ./...

0 comments on commit d8285de

Please sign in to comment.