-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
63 lines (50 loc) · 1.36 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
.PHONY: check
check:
cargo check
.PHONY: checkall
checkall:
cargo check --all-targets --all-features
.PHONY: build
build:
cargo build
.PHONY: buildall
buildall:
cargo build --all-targets --all-features
.PHONY: test
test: TEST = ''
test:
cargo test --lib --verbose -- $(TEST)
integrationtests: FILE = *
integrationtests: TEST = ''
integrationtests:
cargo test --test '$(FILE)' -- $(TEST)
.PHONY: testall
testall: test integrationtests
.PHONY: fmt
fmt:
cargo fmt
.PHONY: fmt-check
fmt-check:
cargo fmt -- --check
.PHONY: clippy
clippy:
cargo clippy --all --tests --examples -- -D warnings
.PHONY: udeps
udeps:
cargo +nightly udeps
# Check that we stick to `mod tests {` style.
.PHONY: check-mod-test
check-mod-test:
! grep --recursive --include="*.rs" "mod test " *
.PHONY: check-version
check-version:
@echo "Skipping the check while we are figuring out what the version means here"
# @echo "Check Cargo.toml version against git version"
# @toml_version=`sed -n -e 's/^version = "\(.*\)"/\1/p' Cargo.toml`; \
# git_version=`git describe --tags $$(git rev-list --tags --max-count=1) | cut -c2-`; \
# [ "$$toml_version" = "$$git_version" ] || \
# (echo "Cargo.toml version ($$toml_version) does not match git version ($$git_version)!" && \
# exit 1)
# Quick tests to run before creating a PR.
.PHONY: pr
pr: fmt buildall testall clippy check-mod-test check-version