-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 770 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (24 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: all test lint vet fmt fmt-check tidy clean
PACKAGES := ./sdk/... ./agent/... ./types/... ./internal/...
FMT_FILES := $(shell find . -name "*.go" -not -path "./types/types.go")
all: fmt vet test
test:
go test -race -count=1 $(PACKAGES)
test-verbose:
go test -race -count=1 -v $(PACKAGES)
vet:
go vet $(PACKAGES)
fmt:
gofmt -w $(FMT_FILES)
fmt-check:
@test -z "$$(gofmt -l $(FMT_FILES))" || (echo "Files not formatted:"; gofmt -l $(FMT_FILES); exit 1)
lint: vet fmt-check
@if command -v golangci-lint > /dev/null 2>&1; then \
golangci-lint run $(PACKAGES); \
else \
echo "golangci-lint not installed - skipping (run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)"; \
fi
tidy:
go mod tidy
clean:
go clean -testcache