-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (34 loc) · 918 Bytes
/
Makefile
File metadata and controls
39 lines (34 loc) · 918 Bytes
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
TERM=xterm-256color
CLICOLOR_FORCE=true
.PHONY: format
format:
@echo "### Formatting project... ###"
ifeq (, $(shell command -v goimports 2> /dev/null))
@echo "Installing goimports..."
go get golang.org/x/tools/cmd/goimports
endif
@goimports -l -w ./
@echo "\n"
.PHONY: run-lint
run-lint: format
@echo "### Running linter... ###"
ifeq (, $(shell command -v golangci-lint 2> /dev/null))
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1
endif
@golangci-lint run
@echo "\n"
.PHONY: test
test:
@echo "### Running tests... ###"
ifeq (, $(shell command -v richgo 2> /dev/null))
@echo "richgo wasn't found, then we are installing"
go get -u github.com/kyoh86/richgo
endif
richgo test ./...
@echo "\n"
.PHONY: build
build:
docker build -t pedroyremolo/transfer-api .
.PHONY: pre-commit
pre-commit: run-lint test
go mod tidy