forked from golangci/golangci-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
115 lines (87 loc) · 3 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.DEFAULT_GOAL = test
.PHONY: FORCE
# enable consistent Go 1.12/1.13 GOPROXY behavior.
export GOPROXY = https://proxy.golang.org
# Build
build: golangci-lint
.PHONY: build
build_race:
go build -race -o golangci-lint ./cmd/golangci-lint
.PHONY: build_race
clean:
rm -f golangci-lint
rm -f test/path
rm -f tools/Dracula.itermcolors
rm -f tools/godownloader
rm -f tools/goreleaser
rm -f tools/svg-term
rm -rf tools/node_modules
.PHONY: clean
# Test
test: export GOLANGCI_LINT_INSTALLED = true
test: build
GL_TEST_RUN=1 ./golangci-lint run -v
GL_TEST_RUN=1 go test -v -parallel 2 ./...
.PHONY: test
test_race: build_race
GL_TEST_RUN=1 ./golangci-lint run -v --timeout=5m
.PHONY: test_race
test_linters:
GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdataWithIssuesDir/$T
.PHONY: test_linters
# Maintenance
generate: install.sh assets/github-action-config.json
fast_generate: assets/github-action-config.json
.PHONY: generate fast_generate
maintainer-clean: clean
rm -rf install.sh
.PHONY: maintainer-clean
fast_check_generated:
$(MAKE) --always-make fast_generate
git checkout -- go.mod go.sum # can differ between go1.12 and go1.13
git diff --exit-code # check no changes
check_generated:
$(MAKE) --always-make generate
git checkout -- go.mod go.sum # can differ between go1.12 and go1.13
git diff --exit-code # check no changes
.PHONY: check_generated
release: .goreleaser.yml tools/goreleaser
./tools/goreleaser
.PHONY: release
snapshot: .goreleaser.yml tools/goreleaser
./tools/goreleaser --snapshot --rm-dist
.PHONY: snapshot
# Non-PHONY targets (real files)
golangci-lint: FORCE
go build -o $@ ./cmd/golangci-lint
tools/godownloader: export GOFLAGS = -mod=readonly
tools/godownloader: tools/go.mod tools/go.sum
cd tools && go build github.com/goreleaser/godownloader
tools/goreleaser: export GOFLAGS = -mod=readonly
tools/goreleaser: tools/go.mod tools/go.sum
cd tools && go build github.com/goreleaser/goreleaser
# TODO: migrate to docs/
tools/svg-term: tools/package.json tools/package-lock.json
cd tools && npm ci
ln -sf node_modules/.bin/svg-term $@
# TODO: migrate to docs/
tools/Dracula.itermcolors:
curl -fL -o $@ https://raw.githubusercontent.com/dracula/iterm/master/Dracula.itermcolors
# TODO: migrate to docs/
assets/demo.svg: tools/svg-term tools/Dracula.itermcolors
./tools/svg-term --cast=183662 --out assets/demo.svg --window --width 110 --height 30 --from 2000 --to 20000 --profile ./tools/Dracula.itermcolors --term iterm2
install.sh: .goreleaser.yml tools/godownloader
./tools/godownloader .goreleaser.yml | sed '/DO NOT EDIT/s/ on [0-9TZ:-]*//' > $@
assets/github-action-config.json: FORCE golangci-lint
go run ./scripts/gen_github_action_config/main.go $@
go.mod: FORCE
go mod tidy
go mod verify
go.sum: go.mod
expand_website_templates:
go run ./scripts/expand_website_templates/main.go
.PHONY: expand_website_templates
update_contributors_list:
cd .github/contributors && npm run all
update_netlify_state:
go run ./scripts/expand_website_templates/main.go -only-state