Skip to content

mturac/pluginpool-test-gap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hero

test-gap

Surface the lines you just changed that have zero test coverage — before the PR review does.

License: MIT Python 3.8+ Claude Code Plugin Tests: 7 passing

TL;DR: /test-gap → markdown table of files where your diff added lines that nothing tests yet.

Why this exists

Repo-wide coverage percentages are useless on a PR — what matters is whether the lines you just touched are covered. CI rarely tells you that, and "100% line coverage" isn't the target anyway. test-gap intersects your branch's diff with an existing coverage report and shows you the gap, sorted worst-first.

Install (Claude Code)

git clone https://github.com/mturac/pluginpool-test-gap ~/.claude/plugins/test-gap

Restart Claude Code; the slash command /test-gap appears.

Quick start

# After running your test suite with coverage:
python3 -m pytest --cov --cov-report=xml         # produces coverage.xml
/test-gap                                         # in Claude Code

Or directly:

python3 scripts/gap.py --format md
python3 scripts/gap.py --base develop --report build/lcov.info

Flags

Flag Default Description
--base main (falls back to master) Diff against this branch
--report auto-detect Path to coverage.xml, lcov.info, or coverage.json
--format json json or md

Supported coverage formats

Format Where it comes from
Cobertura coverage.xml pytest-cov, pytest --cov-report=xml, coverage xml
lcov.info jest --coverage, c8, Istanbul
coverage.json coverage json

Example output (markdown)

| file | changed lines | uncovered | uncovered lines |
|---|---|---|---|
| src/auth/refresh.py | 42 | 11 | 81-83, 102, 117-122 |
| src/util/parse.py | 15 | 7 | 22-28 |

How it works

  1. Reads git diff --unified=0 <base>..HEAD and collects the added line numbers per file.
  2. Parses the coverage report into a {file: {covered_lines}} map.
  3. Intersects: any added line not in the covered set is reported as a gap.
  4. Sorts the table by uncovered-count descending so the worst offenders surface first.

Limitations

  • Coverage is taken at face value — it doesn't know about branch coverage or test quality.
  • Cobertura paths must match diff paths; configure your runner to emit project-relative paths.
  • Empty diffs and no-test repos are handled gracefully (no output).

Examples

Step-by-step walkthroughs with real input fixtures and the helper's actual output live in examples/. Three or four scenarios per plugin — from the happy path to the edge cases the test suite guards.

Part of the pluginpool family

Ten focused Claude Code plugins for everyday productivity: commit-narrator · pr-storyteller · test-gap · deps-doctor · env-lint · secret-guard · standup-gen · todo-harvest · flaky-detector · changelog-forge

License

MIT — see LICENSE. Contributions welcome.

About

Group conventional commits into a CHANGELOG section with semver bump suggestion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors