2019-08-21 19:53:22 +02:00
|
|
|
PACKAGE_NAME := "gitlab.com/toby3d/telegram"
|
2018-07-29 20:41:59 +05:00
|
|
|
PACKAGE_LIST := $(shell go list $(PACKAGE_NAME)/... | grep -v /vendor/)
|
|
|
|
|
2019-08-21 19:46:15 +02:00
|
|
|
.PHONY: all lint test rase coverage tidy
|
2018-07-29 20:41:59 +05:00
|
|
|
|
2019-08-21 19:46:15 +02:00
|
|
|
all: tidy test race lint
|
2018-07-29 20:41:59 +05:00
|
|
|
|
|
|
|
lint: ## Lint the files
|
2019-07-26 15:17:35 +05:00
|
|
|
@golangci-lint run ./...
|
2018-07-29 20:41:59 +05:00
|
|
|
|
|
|
|
test: ## Run unittests
|
2019-07-26 15:17:35 +05:00
|
|
|
@go test -short $(PACKAGE_NAME)/...
|
2018-07-29 20:41:59 +05:00
|
|
|
|
2019-08-21 19:46:15 +02:00
|
|
|
race: tidy ## Run data race detector
|
2018-07-29 20:41:59 +05:00
|
|
|
@go test -race -short ${PACKAGE_LIST}
|
|
|
|
|
|
|
|
coverage: ## Generate global code coverage report
|
2019-07-26 15:17:35 +05:00
|
|
|
@go test -cover -v -coverpkg=$(PACKAGE_NAME)/... ${PACKAGE_LIST}
|
2018-07-29 20:41:59 +05:00
|
|
|
|
2019-08-21 19:46:15 +02:00
|
|
|
tidy: ## Get the dependencies
|
|
|
|
@go mod tidy
|
2018-07-29 20:41:59 +05:00
|
|
|
|
|
|
|
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}'
|