-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (42 loc) · 876 Bytes
/
Makefile
File metadata and controls
53 lines (42 loc) · 876 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
41
42
43
44
45
46
47
48
49
50
51
52
53
# Makefile for syncli
BINARY=syncli
.PHONY: all build clean test fmt lint
all: build
build:
go build -o $(BINARY) .
clean:
rm -f $(BINARY)
fmt:
gofmt -w .
lint:
@if ! command -v golangci-lint >/dev/null 2>&1; then \
echo "WARNING: golangci-lint not installed, skipping lint."; \
else \
golangci-lint run; \
fi
# Run tests
test:
go test -v -race -buildvcs ./...
# Run syncli
run:
./$(BINARY)
# Install dependencies
deps:
go mod tidy
go mod download
# Run all checks
.PHONY: audit
audit:
$(MAKE) test
$(MAKE) lint
go mod tidy -diff
go mod verify
test -z "$(shell gofmt -l .)"
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./...
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
# Coverage report
.PHONY: coverage
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out