-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (51 loc) · 1.53 KB
/
Makefile
File metadata and controls
63 lines (51 loc) · 1.53 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.PHONY: all build test test-verbose test-short lint fmt vet check coverage clean help
# Default target
all: check
# Build the library
build:
go build ./...
# Run tests with race detection
test:
gotestsum --format=testname -- -race ./...
# Run tests with verbose output
test-verbose:
gotestsum --format=testdox -- -race -v ./...
# Run short tests only (skip long-running tests)
test-short:
gotestsum --format=testname -- -race -short ./...
# Run linting
lint:
golangci-lint run ./...
# Format code
fmt:
gofmt -s -w .
goimports -w -local github.com/sageox/agentx .
# Run go vet
vet:
go vet ./...
# Run all checks (format, lint, test)
check: fmt lint test
# Generate test coverage report
coverage:
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
# Clean build artifacts
clean:
go clean ./...
rm -f coverage.out coverage.html
# Show help
help:
@echo "Available targets:"
@echo " all - Run check (default)"
@echo " build - Build the library"
@echo " test - Run tests with race detection"
@echo " test-verbose - Run tests with verbose output"
@echo " test-short - Run short tests only"
@echo " lint - Run golangci-lint"
@echo " fmt - Format code with gofmt and goimports"
@echo " vet - Run go vet"
@echo " check - Run fmt, lint, and test"
@echo " coverage - Generate test coverage report"
@echo " clean - Clean build artifacts"
@echo " help - Show this help"