-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
60 lines (48 loc) · 1.41 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
SHELL=/bin/bash
all:
@make help
.PHONY: help ## Display help commands
help:
@printf 'Usage:\n'
@printf ' make <tagert>\n'
@printf '\n'
@printf 'Targets:\n'
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line) ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
IFS=$$':' ; \
phony_command=($$help_split); \
help_command=`echo $${phony_command[1]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf " %-50s %s\n" $$help_command $$help_info ; \
done
# clippy
.PHONY: clippy ## cargo clippy
clippy:
cargo clippy --workspace --all-targets --all-features -- -D warnings
.PHONY: clippyfix ## cargo clippy --fix
clippyfix:
cargo clippy --allow-dirty --allow-staged --fix --workspace --all-targets --all-features -- -D warnings
.PHONY: cargofix ## cargo fix
cargofix:
cargo fix --allow-dirty --allow-staged --workspace --all-targets --all-features
# toml && lock check
.PHONY: tomlcheck ## cargo toml check
tomlcheck:
cargo audit
# format
.PHONY: fmtcheck ## cargo fmt check
fmtcheck:
cargo fmt --all -- --check
.PHONY: taplocheck ## taplo fmt check
# cargo install taplo-cli --locked
taplocheck:
taplo fmt --check
.PHONY: fmt ## cargo fmt all && taplo fmt all
fmt:
cargo fmt --all && taplo fmt
.PHONY: clean
clean :
cargo clean