🔧 Updated Makefile

Use mod tool instead dep
This commit is contained in:
Maxim Lebedev 2020-01-14 11:11:13 +05:00
parent 63f8154565
commit 88f62c7797
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
1 changed files with 7 additions and 9 deletions

View File

@ -1,14 +1,12 @@
PROJECT_NAMESPACE := $(CI_PROJECT_NAMESPACE)
PROJECT_NAME := $(CI_PROJECT_NAME)
PROJECT_NAMESPACE := $(CI_PROJECT_NAMESPACE)
PROJECT_PATH := "$(PROJECT_NAMESPACE)/$(PROJECT_NAME)"
PACKAGE_NAME := "gitlab.com/$(PROJECT_PATH)"
PACKAGE_PATH := "$(GOPATH)/src/$(PACKAGE_NAME)"
PACKAGE_LIST := $(shell go list $(PACKAGE_NAME)/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
.PHONY: all lint test rase coverage dep
.PHONY: all lint test race coverage tidy
all: dep test race lint
all: tidy test race lint
lint: ## Lint the files
@golangci-lint run ./...
@ -16,14 +14,14 @@ lint: ## Lint the files
test: ## Run unittests
@go test -short $(PACKAGE_NAME)/...
race: dep ## Run data race detector
race: tidy ## Run data race detector
@go test -race -short ${PACKAGE_LIST}
coverage: ## Generate global code coverage report
@go test -cover -v -coverpkg=$(PACKAGE_NAME)/... ${PACKAGE_LIST}
dep: ## Get the dependencies
@go get -v -d -t $(PACKAGE_NAME)/...
tidy: ## Get the dependencies
@go mod tidy
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'