-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
justfile
71 lines (59 loc) · 2.58 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
69
70
71
_list:
@just --list
# Lint workspace with Clippy
clippy:
cargo clippy --workspace --no-default-features
cargo clippy --workspace --no-default-features --all-features
cargo hack --feature-powerset --depth=3 clippy --workspace
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
# Downgrade dev-dependencies necessary to run MSRV checks/tests.
[private]
downgrade-msrv:
cargo update -p=trybuild --precise=1.0.90
# Test workspace using MSRV
test-msrv: downgrade-msrv (test-no-coverage msrv_rustup)
# Test workspace without generating coverage files
[private]
test-no-coverage toolchain="":
cargo {{ toolchain }} test --lib --tests --package=confik-macros
cargo {{ toolchain }} nextest run --package=confik --no-default-features
cargo {{ toolchain }} nextest run --package=confik --all-features
cargo {{ toolchain }} test --doc --workspace --all-features
RUSTDOCFLAGS="-D warnings" cargo {{ toolchain }} doc --workspace --no-deps --all-features
# Test workspace and generate coverage files
test toolchain="": (test-no-coverage toolchain)
@just test-coverage-codecov {{ toolchain }}
@just test-coverage-lcov {{ toolchain }}
# 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 workspace
doc:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features
# Document workspace and watch for changes
doc-watch:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features --open
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features
# Check project
check:
just --unstable --fmt --check
nixpkgs-fmt --check .
fd --type=file --hidden --extension=md --extension=yml --exec-batch prettier --check
fd --hidden --extension=toml --exec-batch taplo format --check
fd --hidden --extension=toml --exec-batch taplo lint
cargo +nightly fmt -- --check
# Format project
fmt:
just --unstable --fmt
nixpkgs-fmt .
fd --type=file --hidden --extension=md --extension=yml --exec-batch prettier --write
fd --hidden --extension=toml --exec-batch taplo format
cargo +nightly fmt