-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 728 Bytes
/
Makefile
File metadata and controls
40 lines (31 loc) · 728 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
38
39
40
.PHONY: all build test lint fmt clean install
# Default target
all: lint test build
# Build the CLI binary
build:
go build -v -o bin/ctxweaver ./cmd/ctxweaver
# Install the CLI binary
install:
go install ./cmd/ctxweaver
# Run tests
test:
go test -v -race ./...
# Run tests with coverage
cover:
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Run linter
lint:
golangci-lint run
# Format code
fmt:
goimports -w -local github.com/mpyw/ctxweaver .
gofmt -w -s .
# Clean build artifacts
clean:
rm -rf bin/
rm -f coverage.out coverage.html
# Verify go.mod is tidy
tidy:
go mod tidy
@git diff --exit-code go.mod go.sum || (echo "go.mod is not tidy" && exit 1)