Add staticcheck tool

This commit is contained in:
dwrz
2026-06-06 01:17:20 +00:00
parent 6fb63c8c90
commit ad58cd78ff
315 changed files with 56337 additions and 4 deletions

View File

@@ -8,14 +8,15 @@ GOVET := go vet
GOIMPORTS := go tool goimports
DEADCODE := go tool deadcode
GOVULNCHECK := go tool govulncheck
STATICCHECK := go tool staticcheck
BIOME := biome
BUILDFLAGS := -buildvcs=true
PLATFORMS := linux/amd64
.PHONY: all build build-all buildinfo check clean deadcode deps fmt help \
imports install lint run test tidy tools uninstall verify vet \
vulncheck $(CMDS)
imports install lint run staticcheck test tidy tools uninstall \
verify vet vulncheck $(CMDS)
## Build all binaries (default target)
all: build
@@ -67,7 +68,7 @@ test:
$(GO) test -cover -race ./...
## Run all linters (fmt, vet, imports, deadcode, vulncheck)
lint: fmt vet imports deadcode vulncheck biome
lint: fmt vet imports deadcode vulncheck staticcheck biome
## Format code using go fmt
fmt:
@@ -75,7 +76,8 @@ fmt:
## Fix imports and format using goimports
imports:
$(GOIMPORTS) -w -local "$(MODULE)" .
find . -type f -name '*.go' -not -path './vendor/*' | \
xargs $(GOIMPORTS) -w -local "$(MODULE)"
## Run go vet
vet:
@@ -96,6 +98,10 @@ check: lint
tidy:
$(GO) mod tidy
## Run staticcheck
staticcheck:
$(STATICCHECK) ./...
## Download dependencies
deps:
$(GO) mod download
@@ -109,6 +115,7 @@ tools:
go get -tool golang.org/x/tools/cmd/deadcode@latest
go get -tool golang.org/x/tools/cmd/goimports@latest
go get -tool golang.org/x/vuln/cmd/govulncheck@latest
go get -tool honnef.co/go/tools/cmd/staticcheck@latest
## Run the specified CMD binary (use ARGS="..." to pass arguments)
# trap '' INT prevents colorize-logs from exiting immediately on Ctrl-C,