-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1.03 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
38
39
40
PROJECT_DIR = $(shell pwd)
PROJECT_BIN = $(PROJECT_DIR)/bin
$(shell [ -f bin ] || mkdir -p $(PROJECT_BIN))
PATH := $(PROJECT_BIN):$(PATH)
GOLANGCI_LINT = $(PROJECT_BIN)/golangci-lint
test:
go test -v -count=1 ./...
test100:
go test -v -count=100 ./...
test-arch:
go test -v ./tests/arch/...
.PHONY: .install-linter
.install-linter:
### INSTALL GOLANGCI-LINT ###
[ -f $(PROJECT_BIN)/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.49.0
.PHONY: lint
lint: .install-linter
### RUN GOLANGCI-LINT ###
$(GOLANGCI_LINT) run ./... --config=./.golangci.toml
.PHONY: lint-fast
lint-fast: .install-linter
$(GOLANGCI_LINT) run ./... --fast --config=./.golangci.toml
.PHONY: cover
cover:
go test -short -count=1 -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
rm coverage.out
.PHONY: gen-mocks
gen-mocks:
mockgen -source=src/pkg/application/application_contracts.go \
-destination=src/pkg/application/mocks/persistence_mocks.go