|
3 | 3 | # The recipes make heavy use of `rustup`'s toolchain syntax (e.g. `cargo +nightly`). `rustup` is |
4 | 4 | # required on the system in order to intercept the `cargo` commands and to install and use the appropriate toolchain with components. |
5 | 5 |
|
6 | | -NIGHTLY_TOOLCHAIN := "nightly-2025-06-10" |
7 | | -STABLE_TOOLCHAIN := "1.87.0" |
| 6 | +NIGHTLY_TOOLCHAIN := "nightly-2025-07-10" |
| 7 | +STABLE_TOOLCHAIN := "1.88.0" |
8 | 8 |
|
9 | 9 | @_default: |
10 | 10 | just --list |
11 | 11 |
|
12 | | -# Light check including format and lint rules. |
13 | | -@check: |
14 | | - # Default to the nightly toolchain for modern format and lint rules. |
15 | | - |
| 12 | +# Quick check including lints and formatting. Run "fix" mode for auto-fixes. |
| 13 | +@check mode="verify": |
| 14 | + # Use nightly toolchain for modern format and lint rules. |
16 | 15 | # Ensure the toolchain is installed and has the necessary components. |
17 | | - rustup component add --toolchain {{NIGHTLY_TOOLCHAIN }} rustfmt clippy |
| 16 | + rustup component add --toolchain {{NIGHTLY_TOOLCHAIN}} rustfmt clippy |
| 17 | + just _check-{{mode}} |
| 18 | + |
| 19 | +# Verify check, fails if anything is off. Good for CI. |
| 20 | +@_check-verify: |
18 | 21 | # Cargo's wrapper for rustfmt predates workspaces, so uses the "--all" flag instead of "--workspaces". |
19 | | - cargo +{{NIGHTLY_TOOLCHAIN }} fmt --check --all |
| 22 | + cargo +{{NIGHTLY_TOOLCHAIN}} fmt --check --all |
20 | 23 | # Lint all workspace members. Enable all feature flags. Check all targets (tests, examples) along with library code. Turn warnings into errors. |
21 | | - cargo +{{NIGHTLY_TOOLCHAIN }} clippy --all-features --all-targets -- -D warnings |
22 | | - # Checking the extremes: all features enabled as well as none. If features are additive, this should expose conflicts. |
23 | | - # If non-additive features (mutually exclusive) are defined, more specific commands are required. |
24 | | - cargo +{{NIGHTLY_TOOLCHAIN }} check --no-default-features --all-targets |
25 | | - cargo +{{NIGHTLY_TOOLCHAIN }} check --all-features --all-targets |
| 24 | + cargo +{{NIGHTLY_TOOLCHAIN}} clippy --all-features --all-targets -- -D warnings |
| 25 | + # Static analysis of types and lifetimes. |
| 26 | + # Nightly toolchain required by benches target. |
| 27 | + cargo +{{NIGHTLY_TOOLCHAIN}} check --all-features --all-targets |
| 28 | + # Build documentation to catch any broken doc links or invalid rustdoc. |
| 29 | + RUSTDOCFLAGS="-D warnings" cargo +{{STABLE_TOOLCHAIN}} doc --all-features --no-deps |
26 | 30 |
|
27 | 31 | # Attempt any auto-fixes for format and lints. |
28 | | -@fix: |
29 | | - # Ensure the toolchain is installed and has the necessary components. |
30 | | - rustup component add --toolchain {{NIGHTLY_TOOLCHAIN}} rustfmt clippy |
| 32 | +@_check-fix: |
31 | 33 | # No --check flag to actually apply formatting. |
32 | 34 | cargo +{{NIGHTLY_TOOLCHAIN}} fmt --all |
33 | 35 | # Adding --fix flag to apply suggestions with --allow-dirty. |
34 | | - cargo +{{NIGHTLY_TOOLCHAIN}} clippy --workspace --all-features --all-targets --fix --allow-dirty -- -D warnings |
| 36 | + cargo +{{NIGHTLY_TOOLCHAIN}} clippy --all-features --all-targets --fix --allow-dirty -- -D warnings |
35 | 37 |
|
36 | 38 | # Run the test suite. |
37 | 39 | @test: |
38 | 40 | # Run all tests. |
39 | | - |
40 | 41 | # "--all-features" for highest coverage, assuming features are additive so no conflicts. |
41 | 42 | # "--all-targets" runs `lib` (unit, integration), `bin`, `test`, `bench`, `example` tests, but not doc code. |
42 | 43 | cargo +{{STABLE_TOOLCHAIN}} test --all-features --all-targets |
|
0 commit comments