11BIN_DIR ?= ./bin
2- DIRS ?= $(shell find . -name '* .go' | grep --invert-match 'vendor' | xargs -n 1 dirname | sort --unique)
32GO_TOOLS := \
43 github.com/git-chglog/git-chglog/cmd/git-chglog \
54 github.com/mattn/goveralls \
2322
2423coveralls :
2524 @echo " ---> Sending coverage info to Coveralls"
26- goveralls -coverprofile=$(COVERAGE_PROFILE ) -service=travis-ci
25+ $( BIN_DIR ) / goveralls -coverprofile=$(COVERAGE_PROFILE ) -service=travis-ci
2726
2827.PHONY : enforce
2928enforce :
@@ -42,7 +41,7 @@ install:
4241 go mod download
4342
4443.PHONY : lint
45- lint :
44+ lint : $( BIN_DIR ) /golangci-lint
4645 @echo " ---> Linting"
4746 $(BIN_DIR ) /golangci-lint run
4847
@@ -52,18 +51,21 @@ release:
5251ifndef tag
5352 $(error tag must be specified)
5453endif
55- git-chglog --output CHANGELOG.md --next-tag $(tag)
54+ $(BIN_DIR)/ git-chglog --output CHANGELOG.md --next-tag $(tag)
5655 sed -i "" "s/version-.*-green/version-$(tag)-green/" README.md
5756 git add CHANGELOG.md README.md
5857 git commit -m $(tag)
5958 git tag $(tag)
6059 git push origin master --tags
6160
6261.PHONY : setup
63- setup : install
62+ setup : $( BIN_DIR ) /golangci-lint
6463 @echo " --> Setting up"
65- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR ) v1.16.0
66- go get $(GO_TOOLS ) && GOBIN=$$(realpath $(BIN_DIR ) ) go install $(GO_TOOLS )
64+ GOBIN=$(PWD ) /$(subst ./,,$(BIN_DIR ) ) go install $(GO_TOOLS )
65+
66+ $(BIN_DIR ) /golangci-lint :
67+ @echo " --> Installing linter"
68+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR ) v1.27.0
6769
6870.PHONY : test
6971test :
0 commit comments