github.com/alwitt/goutils@v0.6.4/Makefile (about) 1 SHELL = bash 2 3 all: lint 4 5 .PHONY: lint 6 lint: .prepare ## Lint the files 7 @go mod tidy 8 @golint ./... 9 @golangci-lint run ./... 10 11 .PHONY: fix 12 fix: .prepare ## Lint and fix vialoations 13 @go mod tidy 14 @golangci-lint run --fix ./... 15 16 .PHONY: test 17 test: .prepare ## Run unittests 18 . .env; go test --count 1 -v -timeout 300s -short ./... 19 20 .PHONY: one-test 21 one-test: .prepare ## Run one unittest 22 . .env; go test --count 1 -v -timeout 30s -run ^$(FILTER) github.com/alwitt/goutils/... 23 24 .prepare: ## Prepare the project for local development 25 @pip3 install --user pre-commit 26 @pre-commit install 27 @pre-commit install-hooks 28 @GO111MODULE=on go install github.com/go-critic/go-critic/cmd/gocritic@v0.5.4 29 @touch .prepare 30 31 help: ## Display this help screen 32 @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'