-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (38 loc) · 1.02 KB
/
Makefile
File metadata and controls
52 lines (38 loc) · 1.02 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
SHELL := /bin/bash
GOLANGCI_LINT ?= $(shell command -v golangci-lint 2>/dev/null || echo $$(go env GOPATH)/bin/golangci-lint)
.PHONY: all fmt fmt-check vet lint test cover build doc-check tidy clean install gates
all: gates
fmt:
gofmt -w .
fmt-check:
@out=$$(gofmt -l .); \
if [ -n "$$out" ]; then \
echo "gofmt needs to be run on:"; \
echo "$$out"; \
exit 1; \
fi
vet:
go vet ./...
lint:
$(GOLANGCI_LINT) run
test:
go test -race -count=1 ./...
cover:
go test -race -coverpkg=./... -coverprofile=coverage.out ./...
@go tool cover -func=coverage.out | tail -1
build:
go build ./...
go build -o /dev/null ./cmd/arcp
doc-check:
@missing=$$(go doc -all ./... 2>&1 | grep -E "^(func|type|var|const) [A-Z]" | grep -v " //" || true); \
if [ -n "$$missing" ]; then \
echo "Public symbols missing godoc comments may exist; run 'go doc -all' to inspect."; \
fi
tidy:
go mod tidy
install:
go install ./cmd/arcp
clean:
rm -f coverage.out
gates: fmt-check vet lint test cover build doc-check
@echo "All gates passed."