-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (33 loc) · 1.1 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
# 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
gofmt -w -s .
gci write ./ --skip-generated -s 'standard,default,prefix(github.com/sumup/go-sdk-gen)'
.PHONY: lint
lint: ## Lint go files
golangci-lint run -v
.PHONY: test
test: ## Run tests
go test -v -failfast -race -timeout 10m ./...
.PHONY: download
download:
@echo Download go.mod dependencies
@go mod download
.PHONE: vulncheck
vulncheck: ## Check for Vulnerabilities (make sure you have the tools install: `make install-tools`)
govulncheck ./...
.PHONY: install
install: ## Install latest version of go-sdk-gen
go install ./cmd/go-sdk-gen/...
.PHONY: generate
generate: ## Generate all test files
@set -e
find ./tests -type f -name 'go.mod' -execdir sh -c 'go generate ./...' \;
.PHONY: update-examples
update-examples: ## Update all examples
@set -e
find ./examples -type f -name 'Makefile' -execdir sh -c 'make' \;