-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 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
.DEFAULT_GOAL = build
ifdef CI
# Disable spinner in CI
SHED_GET_ARGS = --progress off
endif
# Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
setup: ## Install tool dependencies
@shed get $(SHED_GET_ARGS)
.PHONY: setup
clean: ## Clean all build artifacts
@rm -rf coverage
.PHONY: clean
fmt: ## Format all go files
@shed run goimports -w .
.PHONY: fmt
check-fmt: ## Check if any go files need to be formatted
@./scripts/check_fmt.sh
.PHONY: check-fmt
lint: ## Lint go files
@shed run golangci-lint run ./...
.PHONY: lint
# Run tests and collect coverage data
test: ## Run all tests
@mkdir -p coverage
@go test -coverpkg=./... -coverprofile=coverage/coverage.txt ./...
.PHONY: test
cover: test ## Run all tests and generate coverage data
@go tool cover -html=coverage/coverage.txt -o coverage/coverage.html
.PHONY: cover