-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
64 lines (56 loc) · 1.42 KB
/
Makefile
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
59
60
61
62
63
64
pkgs := $(shell go list ./...)
run := .
count := 1
timeout := 120m
## help: Show this help message
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help
## clean: clean testcache
clean:
@echo "--> Clearing testcache"
@go clean --testcache
@rm coverage.txt
.PHONY: clean
## cover: generate to code coverage report.
cover:
@echo "--> Generating Code Coverage"
@go install github.com/ory/go-acc@latest
@go-acc -o coverage.txt $(pkgs)
.PHONY: cover
## deps: Install dependencies
deps:
@echo "--> Installing dependencies"
@go mod download
@go mod tidy
.PHONY: deps
## lint: Run linters golangci-lint and markdownlint.
lint: vet
@echo "--> Running markdownlint"
@markdownlint --config .markdownlint.yaml '**/*.md'
@echo "--> Running yamllint"
@yamllint --no-warnings . -c .yamllint.yml
@echo "--> Running actionlint"
@actionlint
@echo "--> Running govulncheck"
@govulncheck ./...
@echo "--> Running golangci-lint"
@golangci-lint run
.PHONY: lint
## fmt: Run fixes for linters.
fmt:
@echo "--> Formatting markdownlint"
@markdownlint --config .markdownlint.yaml '**/*.md' -f
@echo "--> Formatting go"
@golangci-lint run --fix
.PHONY: fmt
## vet: Run go vet
vet:
@echo "--> Running go vet"
@go vet $(pkgs)
.PHONY: vet
## test: Run the testsuite
test: vet
go test -v $(pkgs) -run $(run) -count=$(count) -timeout $(timeout)
.PHONY: test