-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 921 Bytes
/
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
42
43
44
# Set default shell to bash
SHELL := /bin/bash -o pipefail -o errexit -o nounset
.PHONY: default
default: help
## Format go code
.PHONY: fmt
fmt:
go run golang.org/x/tools/cmd/[email protected] -w .
## lint code
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/[email protected] run ./...
## test code
.PHONY: test
test:
go test -shuffle=on -race -coverprofile=coverage.txt -covermode=atomic ./...
## Build terradoc into bin directory
.PHONY: build
build:
echo "TODO: cmd not added yet"
#go build -o bin/terradoc ./cmd/terradoc
## remove build artifacts
.PHONY: clean
clean:
rm -rf bin/*
## Display help for all targets
.PHONY: help
help:
@awk '/^.PHONY: / { \
msg = match(lastLine, /^## /); \
if (msg) { \
cmd = substr($$0, 9, 100); \
msg = substr(lastLine, 4, 1000); \
printf " ${GREEN}%-30s${RESET} %s\n", cmd, msg; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)