This repository was archived by the owner on Feb 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.38 KB
/
Makefile
File metadata and controls
58 lines (46 loc) · 1.38 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
.PHONY: build test test-cover test-short lint clean install deps
BINARY := cfl
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
DATE := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS := -ldflags "-s -w \
-X github.com/open-cli-collective/confluence-cli/internal/version.Version=$(VERSION) \
-X github.com/open-cli-collective/confluence-cli/internal/version.Commit=$(COMMIT) \
-X github.com/open-cli-collective/confluence-cli/internal/version.Date=$(DATE)"
# Build the binary
build:
go build $(LDFLAGS) -o bin/$(BINARY) ./cmd/cfl
# Run all tests with race detection
test:
go test -v -race ./...
# Run tests with coverage report
test-cover:
go test -v -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
# Run short tests only (skip slow/integration tests)
test-short:
go test -v -short ./...
# Run linter
lint:
golangci-lint run
# Clean build artifacts
clean:
rm -rf bin/ dist/ coverage.out coverage.html
# Install binary to GOPATH/bin
install: build
cp bin/$(BINARY) $(shell go env GOPATH)/bin/
# Download dependencies
deps:
go mod download
go mod tidy
# Run the CLI (for development)
run:
go run ./cmd/cfl $(ARGS)
# Format code
fmt:
go fmt ./...
goimports -w .
# Verify module
verify:
go mod verify