forked from mpictor/go-xtract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 877 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
GO111MODULE := on
export
LINT_VERSION="1.17.1"
.PHONY: lintall
lintall: fmt lint
.PHONY: install
install:
go install github.com/mpictor/go-xtract/cmd/xtract
.PHONY: fmt
fmt: deps
golangci-lint run --disable-all --enable=gofmt --fix
.PHONY: dofmt
dofmt: deps
golangci-lint run --disable-all --enable=gofmt --fix
.PHONY: deps
deps:
@if ! which golangci-lint >/dev/null || [[ "$$(golangci-lint --version)" != *${LINT_VERSION}* ]]; then \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.17.1; \
fi
.PHONY: lint
lint: deps
golangci-lint run
.PHONY: test
test: i18n
go test -race -covermode=atomic -coverprofile=cover.out ./...
.PHONY: integration
integration: install
cd _integration && go test ./... -v
.PHONY: coverage
coverage: test
go tool cover -html=cover.out -o=cover.html