1
1
BIN_DIR ?= ./bin
2
- DIRS ?= $(shell find . -name '* .go' | grep --invert-match 'vendor' | xargs -n 1 dirname | sort --unique)
3
2
GO_TOOLS := \
4
3
github.com/git-chglog/git-chglog/cmd/git-chglog \
5
4
github.com/mattn/goveralls \
23
22
24
23
coveralls :
25
24
@echo " ---> Sending coverage info to Coveralls"
26
- goveralls -coverprofile=$(COVERAGE_PROFILE ) -service=travis-ci
25
+ $( BIN_DIR ) / goveralls -coverprofile=$(COVERAGE_PROFILE ) -service=travis-ci
27
26
28
27
.PHONY : enforce
29
28
enforce :
@@ -42,7 +41,7 @@ install:
42
41
go mod download
43
42
44
43
.PHONY : lint
45
- lint :
44
+ lint : $( BIN_DIR ) /golangci-lint
46
45
@echo " ---> Linting"
47
46
$(BIN_DIR ) /golangci-lint run
48
47
@@ -52,18 +51,21 @@ release:
52
51
ifndef tag
53
52
$(error tag must be specified)
54
53
endif
55
- git-chglog --output CHANGELOG.md --next-tag $(tag)
54
+ $(BIN_DIR)/ git-chglog --output CHANGELOG.md --next-tag $(tag)
56
55
sed -i "" "s/version-.*-green/version-$(tag)-green/" README.md
57
56
git add CHANGELOG.md README.md
58
57
git commit -m $(tag)
59
58
git tag $(tag)
60
59
git push origin master --tags
61
60
62
61
.PHONY : setup
63
- setup : install
62
+ setup : $( BIN_DIR ) /golangci-lint
64
63
@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
67
69
68
70
.PHONY : test
69
71
test :
0 commit comments