Skip to content

Commit

Permalink
makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
DefinitelyNotAGoat committed Feb 25, 2020
1 parent 8f25162 commit 7a014d7
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PROJECT_NAME := "payman"
VERSION := "v2.0.0"
PKG := "github.com/goat-systems/$(PROJECT_NAME)"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)

.PHONY: dep clean test coverage coverhtml lint

checks: fmt lint staticcheck race test ## Runs all quality checks

lint: ## Lint the files
@golint -set_exit_status ${PKG_LIST}

staticcheck: ## Static check the files
@staticcheck ${PKG_LIST}

fmt: ## Static check the files
@go fmt ${PKG_LIST}

test: ## Run unittests
@go test -v ${PKG_LIST}

race: ## Run data race detector
@go test -race -v ${PKG_LIST}

dep: ## Get the dependencies
@go get -u golang.org/x/lint/golint
@go get -u honnef.co/go/tools/...

clean: ## Remove previous build
@rm -f $(PROJECT_NAME)

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}'

0 comments on commit 7a014d7

Please sign in to comment.