-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
41 lines (32 loc) · 1.12 KB
/
justfile
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
# Fail on early and on unset variables in non-shebang recipes
set shell := ["bash", "-euo", "pipefail", "-c"]
# Allow usage of bash methods to handle multiple arguments and work around quoting issues
set positional-arguments
set quiet
@default: fmt lint test
rust_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain.toml`
rust_nightly_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain-nightly.toml`
rust-version:
echo '{{rust_version}}'
rust-nightly-version:
echo '{{rust_nightly_version}}'
test:
cargo test --workspace --all-targets --all-features
cargo test --workspace --doc
lint strict="":
cargo '+{{rust_nightly_version}}' fmt -- --check
cargo clippy \
--workspace \
--tests \
--benches \
--all-targets \
--all-features \
--quiet \
-- {{ if strict != "" { "-D warnings" } else { "" } }}
cargo doc --all --no-deps --document-private-items --all-features --quiet
fmt:
cargo '+{{rust_nightly_version}}' fmt
udeps:
cargo '+{{rust_nightly_version}}' udeps
install-nightly:
rustup toolchain install '{{rust_nightly_version}}'