-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (38 loc) · 1.05 KB
/
Copy pathMakefile
File metadata and controls
55 lines (38 loc) · 1.05 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
GO_TEST = go tool gotest.tools/gotestsum --format pkgname
GO_LINT = go tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
GO_FUMPT = go tool mvdan.cc/gofumpt
# 🔨 TOOLS #
##@ Tools
prep: prep/tools
prep/tools:
@if ! command -v copywrite >/dev/null 2>&1; then \
echo "copywrite is not installed. Installing copywrite..."; \
go install github.com/hashicorp/copywrite@latest; \
fi
@if [ ! -f .lefthook.yml ]; then \
echo "Installing lefthook configuration..."; \
lefthook install; \
fi
# 🧹 Formatting #
##@ Formatting
fmt:
$(GO_FUMPT) -w .
fmt/check:
$(GO_FUMPT) -d .
# 🔍 Linting #
##@ Linting
lint:
$(GO_LINT) run ./...
# ⛹🏽 License #
##@ License
license: license/headers/check
license/headers/check:
copywrite headers --plan
license/headers/apply:
copywrite headers
# 🧪 Testing #
##@ Testing
test/ci: test/unit
test/unit:
mkdir -p build/reports
$(GO_TEST) --junitfile build/reports/test-unit.xml -- -race ./... -count=1 -short -cover -coverprofile build/reports/unit-test-coverage.out