-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 860 Bytes
/
Makefile
File metadata and controls
42 lines (32 loc) · 860 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
35
36
37
38
39
40
41
42
GOLANGCI_LINT_VERSION := v2.10.1
.PHONY: all test vet build lint cover clean setup
all: vet lint test build
## Install development tools
setup:
@command -v golangci-lint >/dev/null 2>&1 || { \
echo "Installing golangci-lint $(GOLANGCI_LINT_VERSION)..."; \
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION); \
}
## Run all tests
test:
go test ./... -count=1
## Run tests with verbose output
test-v:
go test ./... -v -count=1
## Run go vet
vet:
go vet ./...
## Run golangci-lint
lint: setup
golangci-lint run ./...
## Build all packages
build:
go build ./...
## Run tests with coverage report
cover:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
## Remove build artifacts
clean:
rm -f coverage.out coverage.html