-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (38 loc) · 1.07 KB
/
Makefile
File metadata and controls
50 lines (38 loc) · 1.07 KB
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
42
43
44
45
46
47
48
49
50
.DEFAULT_GOAL = check
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_VERSION ?= v2.2.2
TEST_ARGS=-timeout 40s -coverpkg=github.com/ladzaretti/jsoncompleter
bin/golangci-lint-${GOLANGCI_VERSION}:
@mkdir -p bin
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b ./bin $(GOLANGCI_VERSION)
@mv bin/golangci-lint "$@"
bin/golangci-lint: bin/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} bin/golangci-lint
bin/jr: go-mod-tidy
go build -o "bin/jr" ./cmd/jr
.PHONY: go-mod-tidy
go-mod-tidy:
go mod tidy
.PHONY: clean
clean:
go clean -testcache
rm -rf bin/ coverage/
.PHONY: test
test:
go test $(TEST_ARGS)
.PHONY: cover
cover:
@mkdir -p coverage
go test $(TEST_ARGS) -coverprofile coverage/cover.out
.PHONY: coverage-html
coverage-html: cover
go tool cover -html=coverage/cover.out -o coverage/index.html
.PHONY: lint
lint: bin/golangci-lint
bin/golangci-lint run
.PHONY: fix
fix: bin/golangci-lint
bin/golangci-lint run --fix
.PHONY: check
check: lint test