-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (42 loc) · 1.73 KB
/
Makefile
File metadata and controls
65 lines (42 loc) · 1.73 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
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# -- variables --------------------------------------------------------------------------------------
WARNINGS=RUSTDOCFLAGS="-D warnings"
# -- building --------------------------------------------------------------------------------------
.PHONY: build
build: ## Build the project
cargo build --workspace
.PHONY: check
check: ## Run type checker
cargo check --workspace --all-targets
# -- testing --------------------------------------------------------------------------------------
.PHONY: test
test: ## Run all tests
cargo test --workspace
.PHONY: test-docs
test-docs: ## Test documentation examples and build
mdbook test docs
# -- linting --------------------------------------------------------------------------------------
.PHONY: clippy
clippy: ## Run Clippy with configs
$(WARNINGS) cargo +stable clippy --workspace --all-targets --all-features
.PHONY: fix
fix: ## Run Fix with configs
cargo +stable fix --allow-staged --allow-dirty --all-targets --all-features
.PHONY: format
format: ## Run Format using nightly toolchain
cargo +nightly fmt --all
.PHONY: format-check
format-check: ## Run Format using nightly toolchain but only in check mode
cargo +nightly fmt --all --check
.PHONY: lint
lint: format fix clippy ## Run all linting tasks at once (Clippy, fixing, formatting)
# --- docs ----------------------------------------------------------------------------------------
.PHONY: doc
doc: ## Generates & checks documentation
cargo doc --keep-going --release
.PHONY: book
book: ## Builds the book & serves documentation site
mdbook serve --open docs