-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.15 KB
/
Makefile
File metadata and controls
43 lines (34 loc) · 1.15 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
# Make this makefile self-documented with target `help`
.PHONY: help
.DEFAULT_GOAL := help
help: ## Show help
@grep -Eh '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: fmt
fmt: ## Format go files
golangci-lint fmt --verbose
.PHONY: lint
lint: ## Lint go files
golangci-lint run --verbose
.PHONY: lint-fix
lint-fix: ## Lint go files and apply auto-fixes
golangci-lint run --verbose --fix
.PHONY: test
test: ## Run tests
go test -v -failfast -race -timeout 10m ./...
.PHONY: download
download:
@echo Download go.mod dependencies
@go mod download
.PHONY: vulncheck
vulncheck: ## Check for Vulnerabilities (make sure you have the tools install: `make install-tools`)
govulncheck ./...
.PHONY: vulncheck-sarif
vulncheck-sarif: ## Check for Vulnerabilities
govulncheck -format=sarif ./... > govulncheck.sarif
.PHONY: generate
generate: # Generate latest SDK
go generate ./...
.PHONY: install-tools
install-tools: # Install development dependencies
go install golang.org/x/vuln/cmd/govulncheck@latest
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest