-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 828 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 828 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
.PHONY: help test bench lint all coverage
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "Available targets:"
@sed -n 's/^##//p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'
.PHONY: lint
lint:
@echo "Running golangci-lint..."
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run ./...; \
else \
echo "golangci-lint not installed. Visit github.com/golangci/golangci-lint to install."; \
fi
.PHONY: test
test:
@echo "Running tests..."
@go test ./...
.PHONY: cover
cover:
@echo "Generating HTML coverage report..."
@go test -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
.PHONY: bench
bench:
@echo "Running benchmarks..."
@cd benchmark && go test -bench=. -benchmem
.PHONY: all
all: lint test