Debian Codegraph @

Makefile

raw
1 GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '')
2 GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest
3
4 GO_SEC=$(shell which gosec 2> /dev/null || echo '')
5 GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest
6
7 GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '')
8 GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest
9
10 .PHONY: verify
11 verify: sec govulncheck lint test
12
13 .PHONY: lint
14 lint:
15 $(if $(GO_LINT), ,go install $(GO_LINT_URI))
16 @echo "##### Running golangci-lint #####"
17 golangci-lint run -v
18
19 .PHONY: sec
20 sec:
21 $(if $(GO_SEC), ,go install $(GO_SEC_URI))
22 @echo "##### Running gosec #####"
23 gosec ./...
24
25 .PHONY: govulncheck
26 govulncheck:
27 $(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI))
28 @echo "##### Running govulncheck #####"
29 govulncheck ./...
30
31 .PHONY: test
32 test:
33 @echo "##### Running tests #####"
34 go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...