-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (36 loc) · 806 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
-include .env
export
.PHONY: setup
setup: ## Get linting stuffs
go get github.com/golangci/golangci-lint/cmd/golangci-lint
go get golang.org/x/tools/cmd/goimports
.PHONY: test
test: lint ## Test the app
go test \
-v \
-race \
-bench=./... \
-benchmem \
-timeout=120s \
-cover \
-coverprofile=./test_coverage.txt \
-bench=./... ./...
.PHONY: mocks
mocks: ## Generate the mocks
go generate ./...
.PHONY: full
full: fmt lint test ## Clean, build, make sure its formatted, linted, and test it
.PHONY: lint
lint: ## Lint
golangci-lint run --config golangci.yml
.PHONY: fmt
fmt: ## Formatting
gofmt -w -s .
goimports -w .
go clean ./...
.PHONY: pre-commit
pre-commit: fmt lint ## Do formatting and linting
.PHONY: clean
clean: ## Clean
go clean ./...
rm -rf bin/${SERVICE_NAME}