xiaohongshu
xiaohongshu
cargo-tools
Cargo ecosystem tools for testing (nextest), coverage (llvm-cov), and dependency analysis (machete). Use when running tests, measuring coverage, detecting unused dependencies, or optimizing CI pipelines. Triggers: "nextest", "coverage", "llvm-cov", "unused dependencies", "cargo-machete".
Full skill instructions
Essential cargo ecosystem tools for testing, coverage, and dependency management.
Next-generation test runner with process isolation and parallel execution.
cargo install cargo-nextest --locked
cargo nextest run # Run all tests
cargo nextest run test_name # Run specific test
cargo nextest run -p package_name # Run tests in package
cargo nextest run -- --ignored # Run ignored tests
cargo nextest run --test-threads 4 # Control parallelism
cargo nextest run -E 'test(auth)' # Match test name
cargo nextest run -E 'package(my_crate)' # Match package
cargo nextest run -E 'test(auth) and not test(slow)' # Complex filter
cargo nextest run -E 'kind(test)' # Integration tests only
[profile.default]
retries = 0
test-threads = 8
fail-fast = false
success-output = "never"
failure-output = "immediate"
[profile.ci]
retries = 2
fail-fast = true
slow-timeout = { period = "60s", terminate-after = 2 }
[profile.ci.junit]
path = "target/nextest/ci/junit.xml"
[test-groups.database]
max-threads = 1
[profile.default.overrides]
filter = 'test(db_)'
test-group = 'database'
cargo test --docCode coverage using LLVM instrumentation.
cargo install cargo-llvm-cov
rustup component add llvm-tools-preview
cargo llvm-cov # Run with coverage
cargo llvm-cov --html # Generate HTML report
cargo llvm-cov --lcov --output-path lcov.info # LCOV format
cargo llvm-cov --json # JSON format
cargo llvm-cov --text # Text summary
cargo llvm-cov --fail-under-lines 80
cargo llvm-cov --fail-under-functions 75
cargo llvm-cov --fail-under-branches 70 # Requires nightly
cargo llvm-cov nextest --html
cargo llvm-cov nextest --profile ci --lcov --output-path lcov.info
cargo llvm-cov --workspace --html # All workspace members
cargo llvm-cov --all-features --html # All features
cargo llvm-cov --ignore-filename-regex '.*generated.*' # Exclude files
cargo llvm-cov --doc --html # Include doctests
cargo llvm-cov clean # Clean coverage data
rustup toolchain install nightly
rustup component add llvm-tools-preview --toolchain nightly
cargo +nightly llvm-cov --branch --html
Fast detection of unused dependencies.
cargo install cargo-machete
cargo machete # Check for unused deps
cargo machete --with-metadata # Detailed output
cargo machete --fix # Remove unused deps
cargo machete --workspace # Check workspace
Create .cargo-machete.toml:
[ignore]
dependencies = ["serde", "log"]
[ignore.my_crate]
dependencies = ["tokio"]
Or use inline comments in Cargo.toml:
[dependencies]
serde = "1.0" # machete:ignore - used via derive macro
| Feature | cargo-machete | cargo-udeps |
|---|---|---|
| Speed | Very fast | Slower |
| Accuracy | Good | Excellent |
| Rust version | Stable | Nightly required |
# Use both for best results
cargo machete # Fast check
cargo +nightly udeps # Verify with udeps
name: Rust CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@v2
with:
tool: nextest,cargo-llvm-cov,cargo-machete
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo nextest run --profile ci --all-features
- name: Run doctests
run: cargo test --doc --all-features
- name: Check coverage
run: |
cargo llvm-cov nextest \
--all-features \
--fail-under-lines 80 \
--lcov --output-path lcov.info
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check unused dependencies
run: cargo machete --with-metadata
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: cargo-nextest
name: cargo nextest
entry: cargo nextest run
language: system
pass_filenames: false
files: \.rs$
- id: cargo-machete
name: cargo machete
entry: cargo machete
language: system
pass_filenames: false
files: Cargo.toml$
Testing:
cargo nextest run && cargo test --doctest-groupsCoverage:
cargo llvm-cov nextestcargo llvm-cov cleanDependencies:
cargo check after --fixxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience