-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (71 loc) · 1.84 KB
/
Makefile
File metadata and controls
88 lines (71 loc) · 1.84 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.PHONY: build test clean run-example install
# Build the library
build:
go build -o bin/certy .
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Clean build artifacts
clean:
rm -rf bin/
rm -f coverage.out coverage.html
# Run the example
run-example:
cd example && go run main.go
# Build the example
build-example:
cd example && go build -o ../bin/example main.go
# Install the library
install:
go install .
# Format code
fmt:
go fmt ./...
# Lint code
lint:
golangci-lint run
# Check for security vulnerabilities
security:
gosec ./...
# Generate documentation
docs:
godoc -http=:6060
# Update dependencies
deps:
go mod tidy
go mod download
# Show dependency tree
deps-tree:
go mod graph
# Benchmark tests
bench:
go test -bench=. ./...
# Race condition detection
race:
go test -race ./...
# All-in-one command
all: clean fmt lint test build
# Help
help:
@echo "Available commands:"
@echo " build - Build the library"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage report"
@echo " clean - Clean build artifacts"
@echo " run-example - Run the example application"
@echo " build-example - Build the example application"
@echo " install - Install the library"
@echo " fmt - Format code"
@echo " lint - Lint code"
@echo " security - Check for security vulnerabilities"
@echo " docs - Generate documentation"
@echo " deps - Update dependencies"
@echo " deps-tree - Show dependency tree"
@echo " bench - Run benchmarks"
@echo " race - Run tests with race detection"
@echo " all - Run all checks and build"
@echo " help - Show this help message"