Skip to content

Instantly share code, notes, and snippets.

@pirafrank
Created August 13, 2026 23:17
Show Gist options
  • Select an option

  • Save pirafrank/83d7d92c3dd6d1c097c8a2f5ca15bef2 to your computer and use it in GitHub Desktop.

Select an option

Save pirafrank/83d7d92c3dd6d1c097c8a2f5ca15bef2 to your computer and use it in GitHub Desktop.
justfile for Rust projects
# Print all available recipes when running `just` without arguments
default:
just --list
# Get errors and warnings without running the tests
warnings:
cargo test --no-run 2>&1 | grep -A 5 "warning\|error" || true
# Run the formatter
fmt:
cargo fmt
# Check formatting without changing files
fmt-check:
cargo fmt -- --check
# Run Clippy on default targets
lint:
cargo clippy -- --no-deps -D warnings
# Run Clippy on all targets
lint-all:
cargo clippy --all-targets -- --no-deps -D warnings
# Auto-fix Clippy warnings
fix:
cargo clippy --no-deps --fix --allow-dirty -- -D warnings
# Format and lint the entire project
better: fmt lint-all
# Checks suitable for a pre-commit hook
pre-commit: fmt-check lint-all
# Checks suitable for a pre-push hook
pre-push: check test
# Add your project's broader checks here
check: fmt-check lint-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment