-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (70 loc) · 2.25 KB
/
Makefile
File metadata and controls
85 lines (70 loc) · 2.25 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
.PHONY: test test-coverage test-race coverage-html bench bench-all lint lint-install lint-fix doc doc-server build validate clean help
# Running Tests
test:
go test -v ./...
test-coverage:
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
test-race:
go test -v -race ./...
coverage-html: test-coverage
go tool cover -html=coverage.txt
# Running Benchmarks
bench:
go test -bench=. -benchmem ./...
bench-all: bench
@echo "All benchmarks completed"
# Linting
lint-install:
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
lint:
golangci-lint run
lint-fix:
golangci-lint run --fix
# Building
build:
go build -o apibconv ./cmd/apibconv
clean:
rm -f apibconv coverage.txt
# Validation (using the tool itself)
validate:
@echo "Run validation on a spec file:"
@echo " ./apibconv --validate <spec-file>"
# Documentation
doc:
@echo "Package documentation:"
@go doc github.com/amer8/apibconv/pkg/converter
@go doc github.com/amer8/apibconv/pkg/model
@go doc github.com/amer8/apibconv/pkg/format
doc-server:
@echo "Starting documentation server at http://localhost:6060"
@echo "View package docs at: http://localhost:6060/pkg/github.com/amer8/apibconv/"
@echo "Press Ctrl+C to stop"
@command -v godoc >/dev/null 2>&1 || { echo "Installing godoc..."; go install golang.org/x/tools/cmd/godoc@latest; }
godoc -http=:6060
# Help
help:
@echo "Available targets:"
@echo ""
@echo "Testing:"
@echo " test - Run all tests"
@echo " test-coverage - Run tests with coverage report"
@echo " test-race - Run tests with race detector"
@echo " coverage-html - Generate HTML coverage report"
@echo ""
@echo "Benchmarks:"
@echo " bench - Run all benchmarks"
@echo ""
@echo "Linting:"
@echo " lint-install - Install golangci-lint"
@echo " lint - Run linter"
@echo " lint-fix - Run linter with auto-fix"
@echo ""
@echo "Building:"
@echo " build - Build the CLI tool"
@echo " clean - Remove build artifacts"
@echo ""
@echo "Documentation:"
@echo " doc - View package documentation"
@echo " doc-server - Start local documentation server on :6060"
@echo ""
@echo " help - Show this help message"