Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (78 loc) · 1.46 KB
/
Copy pathMakefile
File metadata and controls
95 lines (78 loc) · 1.46 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
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
## Configuration
## =============
.DEFAULT_GOAL := help
.DELETE_ON_ERROR: ;
.SECONDARY:
.SUFFIXES: ;
.PHONY: .FORCE
## Verbs
## =====
help:
@mkhelp $(firstword $(MAKEFILE_LIST))
## Checks
## ------
check: check_build check_docs check_format check_generated_files check_lint check_tests
## _
check_build:
cargo build \
--locked \
--workspace
.PHONY: check_build
## _
check_docs:
RUSTDOCFLAGS="-Dwarnings" cargo doc \
--document-private-items \
--locked \
--no-deps \
--workspace
.PHONY: check_docs
## _
check_format:
find . -type f -name '*.rs' \
| xargs rustfmt --check \
--config imports_granularity=Crate \
--config group_imports=StdExternalCrate \
--edition 2021
cargo fmt --check
.PHONY: check_format
## _
check_generated_files: Cargo.lock
git update-index -q --refresh
git --no-pager diff --exit-code HEAD -- $^
.PHONY: check_generated_files
## _
check_lint:
cargo clippy \
--all-targets \
--locked \
--no-deps \
--workspace \
-- \
-Dwarnings
.PHONY: check_lint
## _
check_tests:
cargo test \
--all-targets \
--locked \
--workspace
.PHONY: check_tests
## Fixes
## -----
## _
fix_format:
find . -type f -name '*.rs' \
| xargs rustfmt \
--config imports_granularity=Crate \
--config group_imports=StdExternalCrate \
--edition 2021
cargo fmt
.PHONY: fix_format
## _
fix_lint:
cargo clippy --fix
.PHONY: fix_lint
## Nouns
## =====
Cargo.lock: $(wildcard crates/*/Cargo.toml)
cargo metadata --format-version=1 > /dev/null