build(makefile): add lint target using golangci-lint
Some checks failed
CI / Test (push) Successful in 28s
CI / Lint (push) Successful in 19s
CI / Build (push) Failing after 31s

Introduces a new `lint` Makefile target that checks for golangci-lint installation,
runs the linter to match CI pipeline, and updates the help message accordingly.
This commit is contained in:
Greg Gauthier 2026-03-01 14:21:36 +00:00
parent cdcbd245d7
commit e0a0144d77

View File

@ -1,4 +1,4 @@
.PHONY: test test-cover test-agent build install clean .PHONY: test test-cover test-agent lint build install clean
test: test:
go test ./... -v go test ./... -v
@ -12,6 +12,10 @@ test-cover:
test-agent: test-agent:
go test -run TestAgent ./... -v go test -run TestAgent ./... -v
lint:
@which golangci-lint > /dev/null || (echo "❌ golangci-lint not found. Install with:" && echo " go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest" && exit 1)
golangci-lint run
build: build:
@mkdir -p build @mkdir -p build
go build -ldflags "-s -w" -trimpath -o build/grokkit . go build -ldflags "-s -w" -trimpath -o build/grokkit .
@ -30,6 +34,7 @@ help:
@echo " test Run all tests" @echo " test Run all tests"
@echo " test-cover Run tests + generate HTML coverage report" @echo " test-cover Run tests + generate HTML coverage report"
@echo " test-agent Run only agent tests" @echo " test-agent Run only agent tests"
@echo " lint Run golangci-lint (matches CI pipeline)"
@echo " build Build optimized binary" @echo " build Build optimized binary"
@echo " install Build and install to ~/.local/bin" @echo " install Build and install to ~/.local/bin"
@echo " clean Remove build artifacts" @echo " clean Remove build artifacts"