-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
38 lines (27 loc) · 1.01 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
.PHONY: help deps lint fmt test test-coverage test-coverage-html release upx clean readme
.DEFAULT_GOAL := help
help: ## List targets & descriptions
@cat Makefile* | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
deps: ## Install dependencies
go mod download
lint: ## Run linters
golangci-lint run
fmt: ## Fix formatting issues
goimports -w .
test: ## Run tests
go test -v -race ./...
test-coverage: ## Launch tests coverage and send it to coverall
mkdir -p .cover
go test -coverprofile .cover/cover.out ./...
test-coverage-html: ## Create a code coverage report in HTML
mkdir -p .cover
go test -coverprofile .cover/cover.out ./...
go tool cover -html .cover/cover.out
release: ## Release
goreleaser --rm-dist --release-notes CHANGELOG.md --skip-validate
upx: ## Compact artifacts
upx dist/*/*
clean: ## Clean up
rm -rf .cover dist
readme: ## Update the table of contents for all README.md's
find . -iname "*.md" -exec markdown-toc -i {} \;