Skip to content

Commit 8f2b49f

Browse files
authored
Merge pull request #118 from nyonson/add-fix-recipe
fix: add a fix recipe for format and lints
2 parents 2b2f26a + 9a5feef commit 8f2b49f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

justfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ _default:
2020
# Lint all workspace members. Enable all feature flags. Check all targets (tests, examples) along with library code. Turn warnings into errors.
2121
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --workspace --all-features --all-targets -- -D warnings
2222

23+
# Attempt any auto-fixes for format and lints.
24+
@fix:
25+
# Ensure the toolchain is installed and has the necessary components.
26+
rustup component add --toolchain {{NIGHTLY_TOOLCHAIN}} rustfmt clippy
27+
# No --check flag to actually apply formatting.
28+
cargo +{{NIGHTLY_TOOLCHAIN}} fmt --all
29+
# Adding --fix flag to apply suggestions with --allow-dirty.
30+
cargo +{{NIGHTLY_TOOLCHAIN}} clippy --workspace --all-features --all-targets --fix --allow-dirty -- -D warnings
31+
2332
# Run a test suite: unit, features, msrv, constraints, or no-std.
2433
@test suite="unit":
2534
just _test-{{suite}}

0 commit comments

Comments
 (0)