@@ -12,19 +12,17 @@ GOBUILD_VERSION_ARGS := -ldflags "-s -X $(VERSION_VAR)=$(REPO_VERSION) -X $(GIT_
12
12
DOCKER_REPO ?= jtblin
13
13
IMAGE_NAME := $(DOCKER_REPO ) /$(BINARY_NAME )
14
14
ARCH ?= darwin
15
- METALINTER_CONCURRENCY ?= 4
16
- METALINTER_DEADLINE ?= 180
15
+ GOLANGCI_LINT_VERSION ?= v1.23.8
16
+ GOLANGCI_LINT_CONCURRENCY ?= 4
17
+ GOLANGCI_LINT_DEADLINE ?= 180
17
18
# useful for passing --build-arg http_proxy :)
18
19
DOCKER_BUILD_FLAGS :=
19
20
20
21
setup :
21
- go get -v -u github.com/Masterminds/glide
22
- go get -v -u github.com/githubnemo/CompileDaemon
23
- go get -v -u github.com/alecthomas/gometalinter
22
+ go get -v -u golang.org/x/tools/cmd/goimports
23
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH ) /bin v1.23.8
24
24
go get -v -u github.com/jstemmer/go-junit-report
25
25
go get -v github.com/mattn/goveralls
26
- gometalinter --install --update
27
- glide install --strip-vendor
28
26
29
27
build : * .go fmt
30
28
go build -o build/bin/$(ARCH ) /$(BINARY_NAME ) $(GOBUILD_VERSION_ARGS ) github.com/jtblin/$(BINARY_NAME ) /cmd
@@ -33,23 +31,23 @@ build-race: *.go fmt
33
31
go build -race -o build/bin/$(ARCH ) /$(BINARY_NAME ) $(GOBUILD_VERSION_ARGS ) github.com/jtblin/$(BINARY_NAME ) /cmd
34
32
35
33
build-all :
36
- go build $$( glide nv )
34
+ go build ./...
37
35
38
36
fmt :
39
- gofmt -w=true -s $$(find . -type f -name '*.go' -not -path "./vendor/*" )
40
- goimports -w=true -d $$(find . -type f -name '*.go' -not -path "./vendor/*" )
37
+ gofmt -w=true -s $$(find . -type f -name '*.go' )
38
+ goimports -w=true -d $$(find . -type f -name '*.go' )
41
39
42
40
test :
43
- go test $$( glide nv )
41
+ go test ./...
44
42
45
43
test-race :
46
- go test -race $$( glide nv )
44
+ go test -race ./...
47
45
48
46
bench :
49
- go test -bench=. $$( glide nv )
47
+ go test -bench=. ./...
50
48
51
49
bench-race :
52
- go test -race -bench=. $$( glide nv )
50
+ go test -race -bench=. ./...
53
51
54
52
cover :
55
53
./cover.sh
@@ -61,29 +59,19 @@ coveralls:
61
59
goveralls -coverprofile=coverage.out -service=travis-ci
62
60
63
61
junit-test : build
64
- go test -v $$( glide nv ) | go-junit-report > test-report.xml
62
+ go test -v ./... | go-junit-report > test-report.xml
65
63
66
64
check :
67
65
go install ./cmd
68
-
69
- gometalinter --concurrency=$(METALINTER_CONCURRENCY) --deadline=$(METALINTER_DEADLINE)s ./... --vendor --linter='errcheck:errcheck:-ignore=net:Close' --cyclo-over=20 \
70
- --linter='vet:go vet --no-recurse -composites=false:PATH:LINE:MESSAGE' --disable=interfacer --dupl-threshold=50
66
+ golangci-lint run --enable=gocyclo --concurrency=$(GOLANGCI_LINT_CONCURRENCY ) --deadline=$(GOLANGCI_LINT_DEADLINE ) s
71
67
72
68
check-all :
73
69
go install ./cmd
74
- gometalinter --concurrency=$(METALINTER_CONCURRENCY ) --deadline=600s ./... --vendor --cyclo-over=20 \
75
- --linter=' vet:govet --no-recurse:PATH:LINE:MESSAGE' --dupl-threshold=50
76
- --dupl-threshold=50
70
+ golangci-lint run --enable=gocyclo --concurrency=$(GOLANGCI_LINT_CONCURRENCY ) --deadline=600s
77
71
78
72
travis-checks : build test-race check bench-race
79
73
80
- watch :
81
- CompileDaemon -color=true -build " make test"
82
-
83
- cross :
84
- CGO_ENABLED=0 GOOS=linux go build -o build/bin/linux/$(BINARY_NAME ) $(GOBUILD_VERSION_ARGS ) -a -installsuffix cgo github.com/jtblin/$(BINARY_NAME ) /cmd
85
-
86
- docker : cross
74
+ docker :
87
75
docker build -t $(IMAGE_NAME ) :$(GIT_HASH ) . $(DOCKER_BUILD_FLAGS )
88
76
89
77
docker-dev : docker
@@ -104,7 +92,5 @@ version:
104
92
105
93
clean :
106
94
rm -rf build/bin/*
107
- -docker rm $(docker ps -a -f 'status=exited' -q )
108
- -docker rmi $(docker images -f 'dangling=true' -q )
109
95
110
96
.PHONY : build version
0 commit comments