| name | testing |
| description | Run tests, linting, and formatting checks for rhusky |
Testing Skill
Use this skill when running tests, checking code quality, or verifying
the codebase compiles and passes all checks.
Running Tests
cargo test
cargo test test_name
cargo test -- --nocapture
Formatting
Formatting requires the nightly toolchain:
cargo +nightly fmt --all -- --check
cargo +nightly fmt --all
Linting with Clippy
Clippy also requires nightly with strict settings:
cargo +nightly clippy --all-targets --all-features -- -D warnings -W missing-docs
This enforces:
- All warnings as errors (
-D warnings)
- Documentation on all public items (
-W missing-docs)
- Max 120 lines per function
- Max nesting depth of 5
Full Check Workflow
Run all checks in sequence:
cargo +nightly fmt --all -- --check && \
cargo +nightly clippy --all-targets --all-features -- -D warnings -W missing-docs && \
cargo test
Building
cargo build
cargo build --release
cargo check
Git Hooks (Automatic Checks)
Git hooks in .githooks/ run automatically on commit:
- pre-commit: Runs fmt and clippy on Rust files
- commit-msg: Validates conventional commit format with scope
- post-commit: Verifies commit signature
Activate hooks: git config core.hooksPath .githooks
Common Issues
Nightly toolchain not installed
rustup install nightly
Missing docs warning
All public items need documentation. Add doc comments:
pub fn my_function() {}