-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
justfile
68 lines (57 loc) · 2.29 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
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
_list:
@just --list
msrv := ```
cargo metadata --format-version=1 \
| jq -r 'first(.packages[] | select(.source == null and .rust_version)) | .rust_version' \
| sed -E 's/^1\.([0-9]{2})$/1\.\1\.0/'
```
msrv_rustup := "+" + msrv
# Check project.
[group("lint")]
check: && clippy
just --unstable --fmt --check
fd --hidden -e=toml --exec-batch taplo format --check
fd --hidden -e=toml --exec-batch taplo lint
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --check
cargo +nightly fmt -- --check
# Format project.
[group("lint")]
fmt: update-readmes
just --unstable --fmt
fd --hidden -e=toml --exec-batch taplo format
fd --hidden --type=file -e=md -e=yml --exec-batch prettier --write
cargo +nightly fmt
# Update READMEs from crate root documentation.
[group("lint")]
update-readmes:
cargo rdme --workspace-project=oas3 --readme-path=crates/oas3/README.md --force
cargo rdme --workspace-project=roast --readme-path=crates/roast/README.md --force
# Lint workspace with Clippy.
[group("lint")]
clippy:
cargo clippy --workspace --all-targets --no-default-features
cargo clippy --workspace --all-targets --all-features
cargo hack --feature-powerset clippy --workspace --all-targets
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private]
downgrade-msrv:
@ echo "No downgrades currently necessary"
# Test workspace using MSRV.
[group("test")]
test-msrv: downgrade-msrv (test msrv_rustup)
# Test workspace.
[group("test")]
test toolchain="":
cargo {{ toolchain }} nextest run --workspace --no-default-features
cargo {{ toolchain }} nextest run --workspace --all-features
cargo {{ toolchain }} test --doc --workspace --all-features
RUSTDOCFLAGS="-D warnings" cargo {{ toolchain }} doc --workspace --no-deps --all-features
# Test workspace and generate Codecov coverage file
test-coverage-codecov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --codecov --output-path codecov.json
# Test workspace and generate LCOV coverage file
test-coverage-lcov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --lcov --output-path lcov.info
# Document crates in workspace.
doc *args:
RUSTDOCFLAGS="--cfg=docsrs -Dwarnings" cargo +nightly doc --workspace --all-features {{ args }}