mcpField
C
check-rust-coverage

check-rust-coverage

github.com/redisearchTesting & quality6.2k63 installsUpdated today
Repository

About check-rust-coverage

A skill for finding Rust source lines not covered by tests. It accepts crate paths, including multiple paths or directories, and reports uncovered line numbers using `cargo llvm-cov` output.

Key features

  1. 01Accepts one or multiple crate paths
  2. 02Handles directories containing Rust crates
  3. 03Reports uncovered lines by file

Use cases

  1. 01Locate untested lines in a Rust crate
  2. 02Review coverage across several crates

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/redisearch/redisearch --skill check-rust-coverage

After installing, type/check-rust-coveragein Claude Code to confirm it loaded.

Details

From the project README

Check Rust Coverage

Determine which Rust lines are not covered by Rust tests.

Arguments

  • <path>: Path to a Rust crate.
  • <path 1> <path 2>: Multiple crate paths.

If a path doesn't include src/, assume it to be in the src/redisearch_rs directory. E.g. numeric_range_tree becomes src/redisearch_rs/numeric_range_tree. If a path points to a directory, consider all Rust crates in that directory.

Instructions

Run

cargo llvm-cov test --manifest-path <crate_directory>/Cargo.toml --quiet --json 2>/dev/null | jq -r '"Uncovered Lines:",
(.data[0].files[] |
  select(.summary.lines.percent < 100) |
  .filename as $f |
  [.segments[] | select(.[2] == 0 and .[4] == true) | .[0]] |
  unique |
  if length > 0 then "\($f): \(join(", "))" else empty end
)'

to get the list of uncovered lines for each file in the target crate.

Comments

Markdown supported