add make check target
This commit is contained in:
parent
ae70cf6fb5
commit
7b1cd0debc
9
Makefile
9
Makefile
@ -79,3 +79,12 @@ modcache.tzst: go.mod go.sum
|
|||||||
go mod download -x
|
go mod download -x
|
||||||
cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
|
cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
|
|
||||||
|
# Run all checks (formatting, linting, tests) without modifying files
|
||||||
|
check:
|
||||||
|
@echo "==> Checking formatting..."
|
||||||
|
@test -z "$$(gofmt -l .)" || (echo "Files not formatted:" && gofmt -l . && exit 1)
|
||||||
|
@echo "==> Running linter..."
|
||||||
|
golangci-lint run ./...
|
||||||
|
@echo "==> Running tests..."
|
||||||
|
go test -race -timeout 30s ./...
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user