Use for Rust linting, formatting, type checking, test coverage, and project validation. Covers clippy, rustfmt, cargo check, and tarpaulin.
From psnnpx claudepluginhub aladac/claude-pluginsThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Configures VPN and dedicated connections like Direct Connect, ExpressRoute, Interconnect for secure on-premises to AWS, Azure, GCP, OCI hybrid networking.
Comprehensive guide to Rust linting, formatting, type checking, and coverage.
Rust's compiler IS the type checker. Fast check without building:
# Check without building
cargo check
# Check all targets (including tests, examples)
cargo check --all-targets
# Check with all features
cargo check --all-features
Comes with rustup:
rustup component add clippy
# Cargo.toml
[lints.clippy]
pedantic = "warn"
nursery = "warn"
# Specific overrides
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
Or in code:
// lib.rs or main.rs
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
# Check
cargo clippy
# Check all targets
cargo clippy --all-targets --all-features
# Fix (where possible)
cargo clippy --fix
# Treat warnings as errors (CI)
cargo clippy -- -D warnings
| Category | Flag | Description |
|---|---|---|
| Default | (none) | Common issues |
| Pedantic | clippy::pedantic | Stricter, opinionated |
| Nursery | clippy::nursery | Experimental lints |
| Restriction | clippy::restriction | Very strict |
rustup component add rustfmt
# rustfmt.toml
edition = "2021"
max_width = 100
tab_spaces = 4
use_small_heuristics = "Default"
imports_granularity = "Module"
group_imports = "StdExternalCrate"
reorder_imports = true
# Format all
cargo fmt
# Check without modifying (CI)
cargo fmt -- --check
# Format specific file
rustfmt src/lib.rs
cargo install cargo-tarpaulin
# Generate HTML report
cargo tarpaulin --out Html
# Generate XML for CI
cargo tarpaulin --out Xml
cargo install cargo-llvm-cov
cargo llvm-cov --html
Run all checks:
# Format check + Lint + Tests
cargo fmt -- --check && cargo clippy -- -D warnings && cargo test
# With all features
cargo fmt -- --check && \
cargo clippy --all-targets --all-features -- -D warnings && \
cargo test --all-features
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
pedantic = "warn"
nursery = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
# .github/workflows/ci.yml
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --all-features
- name: Doc
run: cargo doc --no-deps
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Coverage
run: cargo tarpaulin --out Xml
- uses: codecov/codecov-action@v4
#!/bin/sh
# .git/hooks/pre-commit
cargo fmt -- --check || exit 1
cargo clippy -- -D warnings || exit 1
cargo test || exit 1
| Operation | Command |
|---|---|
| Type check | cargo check |
| Lint check | cargo clippy |
| Lint fix | cargo clippy --fix |
| Format check | cargo fmt -- --check |
| Format fix | cargo fmt |
| Test | cargo test |
| Coverage | cargo tarpaulin --out Html |
| All checks | cargo fmt -- --check && cargo clippy -- -D warnings && cargo test |
| All fixes | cargo fmt && cargo clippy --fix --allow-dirty |
# Build docs
cargo doc
# Build and open
cargo doc --open
# Include private items
cargo doc --document-private-items