File tree 5 files changed +51
-8
lines changed
5 files changed +51
-8
lines changed Original file line number Diff line number Diff line change 1
1
go-md2man
2
+ bin
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ matrix:
12
12
- go : tip
13
13
14
14
script :
15
- - if [ "${TRAVIS_GO_VERSION}" = "stable" ]; then script/setup/dev-tools; fi
16
- - go build -i .
15
+ - if [ "${TRAVIS_GO_VERSION}" = "stable" ]; then make golangci-lint
17
16
- if [ "${TRAVIS_GO_VERSION}" = "stable" ]; then echo running check scripts; make check; fi
18
- - go build
19
- - go test -v ./...
17
+ - make build
18
+ - make TEST_FLAGS="-v" test
Original file line number Diff line number Diff line change
1
+ LINTER_BIN ?= golangci-lint
2
+
3
+ .PHONY :
4
+ build : bin/go-md2man
5
+
6
+ .PHONY : clean
7
+ clean :
8
+ @rm -rf bin/*
9
+
1
10
.PHONY : check
2
- check :
3
- golangci-lint run
11
+ check : lint
12
+
13
+ .PHONY : test
14
+ test :
15
+ @go test $(TEST_FLAGS ) ./...
16
+
17
+ .PHONY : lint
18
+ lint :
19
+ @$(LINTER_BIN ) run --new-from-rev " HEAD~$( git rev-list master.. --count) " ./...
20
+
21
+ bin/go-md2man : actual_build_flags := $(BUILD_FLAGS ) -o bin/go-md2man
22
+ bin/go-md2man : bin
23
+ @CGO_ENABLED=0 go build $(actual_build_flags )
24
+
25
+ bin :
26
+ @mkdir ./bin
27
+
28
+ $(LINTER_BIN ) : linter_bin_path := $(shell which $(LINTER_BIN ) )
29
+ $(LINTER_BIN ) :
30
+ @if [ -z $( linter_bin_path) ] || [ ! -x $( linter_bin_path) ]; then \
31
+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH) /bin v1.15.0; \
32
+ fi
33
+
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ exit_code=0
6
+
7
+ make mod
8
+ git diff --exit-code go.mod go.sum || exit_code=$?
9
+
10
+ if [ ${exit_code} -eq 0 ]; then
11
+ exit 0
12
+ fi
13
+
14
+ echo " please run \` make mod\` and check in the changes"
15
+ exit ${exit_code}
Original file line number Diff line number Diff line change 2
2
3
3
set -eu -o pipefail
4
4
5
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $( go env GOPATH) /bin v1.15.0
6
-
7
5
go get -u github.com/golang/dep/cmd/dep
You can’t perform that action at this time.
0 commit comments