-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
38 lines (26 loc) · 1.07 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
.DEFAULT_GOAL := help
# https://gist.github.com/tadashi-aikawa/da73d277a3c1ec6767ed48d1335900f3
.PHONY: $(shell grep -E '^[a-zA-Z_-]+:' $(MAKEFILE_LIST) | sed 's/://')
install: ## install slacts command
go install github.com/crowdworks/slacts/cmd/slacts
test: ## run tests for all package
go test -v ./...
coverage: ## measure tests coverage and generate coverage profile html
go test -coverprofile coverprofile -v ./...
go tool cover -html coverprofile -o coverprofile.html
govet: ## exec go vet checks all for package
go vet ./...
golint: ## exec golint checks all for package
golint ./...
goimports: ## exec goimports checks all for package
goimports -l .
goimports-fix: ## fix format by goimports
goimports -w .
lint: lint-docker lint-golang ## lint all
lint-docker: ## lint Dockerfile
hadolint Dockerfile
lint-golang: ## lint golang code
golangci-lint run ./...
# https://postd.cc/auto-documented-makefile/
help: ## show help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'