forked from RonTuretzky/monorepo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
71 lines (54 loc) · 1.96 KB
/
justfile
File metadata and controls
71 lines (54 loc) · 1.96 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
set positional-arguments := true
env_nightly_version := env("NIGHTLY_VERSION", "nightly")
nightly_version := if env_nightly_version != "" { "+" + env_nightly_version } else { "" }
alias f := fix-fmt
alias l := lint
alias b := build
alias t := test
alias pr := pre-pr
# default recipe to display help information
default:
@just --list
# Build the workspace
build *args='':
cargo build $@
# Runs pre-flight lints + tests before making a pull-request
pre-pr: lint test-docs test
# Fixes the formatting of the workspace
fix-fmt:
cargo {{ nightly_version }} fmt --all
# Fixes the formatting of the `Cargo.toml` files in the workspace
fix-toml-fmt:
find . -name Cargo.toml -type f -print0 | xargs -0 -n1 ./.github/scripts/lint_cargo_toml.py
# Check the formatting of the workspace
check-fmt:
cargo {{ nightly_version }} fmt --all -- --check
# Run clippy lints
clippy *args='':
cargo clippy --all-targets $@ -- -D warnings
# Runs all lints (fmt, clippy, and docs.)
lint: check-fmt clippy check-docs
# Tests benchmarks in a given crate
test-benches crate *args='':
cargo test --benches -p {{ crate }} {{ args }} -- --verbose
# Run tests
test *args='':
cargo nextest run $@
# Test the Rust documentation
test-docs *args='--all':
cargo test --doc --locked $@
# Lint the Rust documentation
check-docs *args='':
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --document-private-items $@
# Run all fuzz tests in a given directory
fuzz fuzz_dir max_time='60' max_mem='4000':
#!/usr/bin/env bash
for target in $(cargo {{nightly_version}} fuzz list --fuzz-dir {{fuzz_dir}}); do
cargo {{nightly_version}} fuzz run $target --fuzz-dir {{fuzz_dir}} -- -max_total_time={{max_time}} -rss_limit_mb={{max_mem}}
done
# Check for unused dependencies
udeps:
cargo {{ nightly_version }} udeps --all-targets
# Run miri tests on a given module
miri module *args='':
MIRIFLAGS="-Zmiri-disable-isolation" cargo miri nextest run --lib {{ module }} {{ args }}