-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
38 lines (31 loc) · 955 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
.PHONY: update-dependencies
update-dependencies:
@go get -t -u ./... && go mod tidy
.PHONY: format
format:
goimports -local github.com/justcodes/loafer-go -w -l .
.PHONY: lint
lint:
@$(MAKE) format
@golangci-lint run --allow-parallel-runners ./... --max-same-issues 0
.PHONY: install-golang-ci
install-golang-ci:
@echo "Installing golang-ci"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1
@echo "Golang-ci installed successfully"
.PHONY: install-goimports
install-goimports:
@echo "Installing go imports"
@go install golang.org/x/tools/cmd/goimports@latest
@echo "Go imports installed successfully"
.PHONY: configure
configure:
make install-golang-ci
make install-goimports
.PHONY: clean
clean:
@go clean -testcache
.PHONY: test
test:
@$(MAKE) -s clean
@go test -timeout 1m -race -covermode=atomic -coverprofile=tmp.out ./... && cat tmp.out | grep -Ev 'example|fake' > geral.out && go tool cover -func=geral.out