-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (57 loc) · 1.49 KB
/
Copy pathMakefile
File metadata and controls
71 lines (57 loc) · 1.49 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
64
65
66
67
68
69
70
71
.PHONY: run test cover lint clean build help
# Default target
help:
@echo "Available commands:"
@echo " run - Run the bot"
@echo " test - Run all tests with verbose output"
@echo " cover - Run tests with coverage report"
@echo " lint - Run golangci-lint"
@echo " clean - Clean build artifacts and coverage files"
@echo " build - Build the bot binary"
@echo " deps - Install dependencies"
# Run the bot
run:
go run cmd/modular/main.go
# Run all tests with verbose output
test:
go test ./internal/... -v
# Run tests with coverage report
cover:
go test ./internal/... -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
@echo "Coverage summary:"
@go tool cover -func=coverage.out | tail -1
# Run golangci-lint
lint:
golangci-lint run
# Clean build artifacts and coverage files
clean:
rm -rf coverage.out coverage.html
rm -rf main bot_modular
rm -rf cmd/modular/modular
# Build the bot binary
build:
go build -o bot_modular cmd/modular/main.go
# Build modular version
build-modular:
go build -o cmd/modular/modular cmd/modular/main.go
# Install dependencies
deps:
go mod tidy
go mod download
# Install development tools
dev-tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Run tests with race detection
test-race:
go test -race ./internal/...
# Run benchmarks
bench:
go test -bench=. ./internal/...
# Format code
fmt:
go fmt ./...
# Vet code
vet:
go vet ./...