forked from andygrunwald/go-jira
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 1.19 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
.DEFAULT_GOAL := help
.PHONY: help
help: ## Outputs the help.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: test
test: ## Runs all unit, integration and example tests.
go test -v -race ./...
.PHONY: test-coverage
test-coverage: ## Runs all unit tests + gathers code coverage
go test -v -race -coverprofile coverage.txt ./...
.PHONY: test-coverage-html
test-coverage-html: test-coverage ## Runs all unit tests + gathers code coverage + displays them in your default browser
go tool cover -html=coverage.txt
.PHONY: vet
vet: ## Runs go vet (to detect suspicious constructs).
go vet ./...
.PHONY: fmt
fmt: ## Runs go fmt (to check for go coding guidelines).
gofmt -d -s .
.PHONY: staticcheck
staticcheck: ## Runs static analysis to prevend bugs, foster code simplicity, performance and editor integration.
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
.PHONY: all
all: test vet fmt staticcheck ## Runs all source code quality targets (like test, vet, fmt, staticcheck)
.PHONY: docs-serve
docs-serve: ## Runs the documentation development server (based on mkdocs)
mkdocs serve