-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
192 lines (146 loc) · 4.16 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!make
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
sed -E 's/:.+## /@/g' | \
LC_ALL=C sort -t@ -k1,1 | \
column -s@ -t
bash-all: bash-fmt bash-check bash-lint ## Run all bash tests
bash-check: ## Check format bash code
@find . -type f -name "*.sh" | xargs shfmt -i 2 -d
bash-deps: ## Install bash dependencies
@sudo apt-get install -y moreutils
bash-fmt: ## Format bash code
@find . -type f -name "*.sh" | xargs shfmt -i 2 -w
bash-lint: ## Check lint bash code
@find . -type f -name "*.sh" | xargs shellcheck -o all
comments-tidy: ## Tidy comments within code
@./dev/comments-tidy.sh
doc-changelog: ## Write CHANGELOG.md
@git cliff -o CHANGELOG.md
doc-readme: ## Write README.md
@./dev/doc-readme.sh
dprint-check: ## Dprint check
@dprint check
dprint-fmt: ## Dprint format
@dprint fmt
go-audit: ## Audit go vulnerabilities
@govulncheck ./...
go-build: ## Build go binary
@go build
go-deps: ## Install go dependencies
@go install github.com/axw/gocov/gocov@latest
@go install github.com/golangci/golangci-lint/cmd/[email protected]
@go install github.com/matm/gocov-html/cmd/gocov-html@latest
@go install github.com/segmentio/golines@latest
@go install golang.org/x/vuln/cmd/govulncheck@latest
go-fmt: ## Format go code
@golines -w .
go-lint: ## Lint go code
@golangci-lint run -c ./.golangci.yml
go-lint-fix: ## Fix lint go code
@golangci-lint run --fix -c ./.golangci.yml
go-outdated: ## Display when go dependencies are out of date
@go list -u -m all
go-run: ## Run go app
@go run main.go
go-tests: ## Run go tests
@go test ./... -v
links-check: ## Check links
@./dev/links-check.sh
links-mirror: ## Mirror links
@./dev/links-mirror.sh
lua-check: ## Check format lua code
@find . -name "*.lua" | xargs stylua -c
lua-fmt: ## Format Lua code
@find . -name "*.lua" | xargs stylua
makefile-descriptions: ## Check if all Makefile rules have descriptions
@./dev/makefile-descriptions.sh
rs-audit: ## Audit Cargo.lock
@cargo audit
rs-audit-fix: ## Update Cargo.toml to fix vulnerable dependency requirement
@cargo audit fix
rs-build: ## Build binary
@cargo build --release --locked --frozen --bins
rs-cargo-deps: ## Install cargo dependencies
@cargo install --locked cargo-outdated
@cargo install cargo-audit --features=fix
@cargo install cargo-watch
@cargo install typos-cli
@rustup component add clippy
rs-check: ## Run check
@cargo check
rs-dev: ## Run check in watch mode
@cargo watch -c
rs-doc: ## Open app documentation
@cargo doc --open
rs-fix: ## Fix rust code
@cargo fix --allow-dirty --allow-staged --all-features --all-targets
rs-fmt: ## Format rust code
@cargo fmt --all --check
rs-fmt-fix: ## Format fix rust code
@cargo fmt --all
rs-install: ## Install binary
@cargo install --path .
rs-lint: ## Lint rust code
@cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
rs-lint-fix: ## Fix lint rust code
@cargo clippy --workspace --all-targets --all-features --no-deps --allow-dirty --allow-staged --fix -- -D warnings
rs-outdated: ## Display when dependencies are out of date
@cargo outdated -wR
rs-tests: ## Run tests
@cargo test
rs-uninstall: ## Uninstall binary
@cargo uninstall
rs-update-cargo: ## Update dependencies
@cargo update
rs-update-rustup: ## Update rust
@rustup update
typos: ## Check typos
@typos
typos-fix: ## Fix typos
@typos -w
.PHONY: bash-all
.PHONY: bash-check
.PHONY: bash-deps
.PHONY: bash-fmt
.PHONY: bash-lint
.PHONY: comments-tidy
.PHONY: doc-changelog
.PHONY: doc-readme
.PHONY: dprint-check
.PHONY: dprint-fmt
.PHONY: go-audit
.PHONY: go-build
.PHONY: go-deps
.PHONY: go-fmt
.PHONY: go-lint
.PHONY: go-lint-fix
.PHONY: go-outdated
.PHONY: go-run
.PHONY: go-tests
.PHONY: help
.PHONY: links-check
.PHONY: links-mirror
.PHONY: lua-check
.PHONY: lua-fmt
.PHONY: makefile-descriptions
.PHONY: rs-audit
.PHONY: rs-audit-fix
.PHONY: rs-build
.PHONY: rs-cargo-deps
.PHONY: rs-check
.PHONY: rs-dev
.PHONY: rs-doc
.PHONY: rs-fix
.PHONY: rs-fmt
.PHONY: rs-fmt-fix
.PHONY: rs-install
.PHONY: rs-lint
.PHONY: rs-lint-fix
.PHONY: rs-outdated
.PHONY: rs-tests
.PHONY: rs-uninstall
.PHONY: rs-update-cargo
.PHONY: rs-update-rustup
.PHONY: typos
.PHONY: typos-fix