-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 858 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
makefile := $(firstword $(MAKEFILE_LIST))
##
## 🔨 GENERAL
##
.PHONY: help
help: ## Help.
@echo "Targets:"
@grep -F -h "##" $(makefile) | grep -F -v grep -F | sed -e 's/\\$$//' | sed -e 's/\(.*\):.*##[ \t]*/ \1 ## /' | column -t -s '##'
@echo
.PHONY: install
install: ## Install utilities.
@echo "Installing dependencies..."
@go install golang.org/x/tools/cmd/goimports@latest
@@$(shell curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin latest)
##
## ✨ TESTING & QUALITY
##
.PHONY: test
test: ## Run unit tests.
@echo "Running tests"
@go test $$(go list ./...)
.PHONY: fmt
fmt: ## Format the code.
@echo "Formatting the code"
@gofmt -s -w .
.PHONY: lint
lint: ## Lint code.
@echo "Linting the code"
@golangci-lint -v --color always run --sort-results ./...