Skip to content
Skills Library
Programming · Testing

check-rust-coverage

/check-rust-coverage

Check which Rust lines are not covered by Rust tests. Use this when you developed new Rust code and want to ensure it is tested.

Repository
RediSearch ↗
Licence
AGPL-3.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Check which Rust lines are not covered by Rust tests. Use this when you developed new Rust code and want to ensure it is tested.

Original author description

Check which Rust lines are not covered by Rust tests. Use this when you developed new Rust code and want to ensure it is tested.

How it works

  1. Arguments
  2. Instructions
Original SKILL.md headings · 54 lines, 359 words
SKILL.md preview
---
name: check-rust-coverage
description: Check which Rust lines are not covered by Rust tests. Use this when you developed new Rust code and want to ensure it is tested.
---

# 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

```bash
NEXTEST_PROFILE=coverage cargo +$(cat .rust-nightly) llvm-cov nextest --manifest-path <crate_directory>/Cargo.toml --branch --json 2>/dev/null | jq -r '"Uncovered Lines:",
(.data[0].files[] |
  .filename as $f |
  [.segments[] | select(.[2] == 0 and .[4] == true) | .[0]] |
  unique |
  if length > 0 then "\($f): \(join(", "))" else empty end
),
"Partially Covered Branches (line: true/false):",
(.data[0].files[] |
  .filename as $f |
  [.branches | group_by(.[0:4])[] |
    {line: .[0][0], t: (map(.[4]) | add), f: (map(.[5]) | add)} |
    select(.t == 0 or .f == 0) | "\(.line): \(.t)/\(.f)"] |
  unique |
  if length > 0 then "\($f): \(join(", "))" else empty end
)'
```

from the repository root to get, for each file in the target crate, the lines no test
executes and the conditions no test drives both ways.

This mirrors the CI coverage job, which Codecov reports from:
- `--branch` is what catches a condition that runs but never takes one of its outcomes,
  such as one operand of an `&&` chain that is never false. Without it such a line counts
  as covered.
- `--branch` needs nightly, and only the pinned `.rust-nightly` is known to work: an
  unpinned `+nightly` can silently produce a report with every line at zero.
- `NEXTEST_PROFILE=coverage` gives tests the longer timeouts that branch instrumentation
  needs; under the default profile slow tests are killed and no report is written.
- Generic code yields one branch entry per instantiation, so the query sums them per
  condition before deciding it is partially covered.

Ignore lines that exist only to reject states the code rules out, as no test can reach
them: `unreachable!`, `unreachable_unchecked`, `debug_assert!` and its variants, and a
`panic!` or `expect` guarding an invariant. A condition inside a `debug_assert!` that never
fails shows as partially covered for the same reason.

Versions

The database has no other skills named check-rust-coverage.

Database snapshot: 13.11.2026 · package version 7e4ce85023ca (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100check-flow-coverage
    Check which C source lines are not covered by Python flow tests. Use this when you want to ensure your C code changes are exercised by end-to-end Python tests. For Rust coverage, use /check-rust-coverage instead.
  • 90write-rust-tests
    Write Rust tests to verify correctness of Rust code. Use this when you want to write Rust tests.
  • 96rust-port
    Use when porting code to Rust from another language, or rewriting a module in Rust.
  • 100rust
    Provides Rust coding best practices for structure, patterns, performance, and error handling. Use when writing or reviewing Rust code, or when the user asks for Rust style guidance.
  • 86rust-review
    Use when reviewing Rust code, a Rust diff or a crate before it lands, or when asked whether Rust code is sound or idiomatic.
  • 100rust
    Guide for Rust programming language. Use when writing Rust code, setting up Rust projects, or needing an overview of Rust development workflows.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.