Skip to content
pubscout

pull_request_coverage

2.1.5, released 7 months ago by an unverified publisher

CLI tool that checks test coverage only on lines added in a pull request

$ flutter pub add pull_request_coverage
Source repository

What it does

It parses an lcov.info file and a git diff, then reports how many new lines are uncovered and whether thresholds are met. The output can be plain CLI or Markdown for PR comments.

AI-written summary of version 2.1.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to enforce coverage on new code in a PR
  • You need a CI step that fails when new lines are not tested
  • You prefer a diff‑based coverage metric over overall project coverage

Skip it when

  • You need coverage for the entire codebase, not just new lines
  • You are working on a non‑Dart project

Strengths

  • Diff‑based coverage focuses on new code
  • Configurable thresholds and ignore patterns
  • Supports Markdown output for PR comments
  • Can be run as a global binary or in CI scripts

Weaknesses

  • Only works with lcov.info from Flutter or coverage package
  • Requires manual generation of lcov.info
  • No integration with IDEs or test runners

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5

Run `flutter test --coverage` to generate lcov.info, then pipe `git diff` into the tool. No build_runner or permissions needed.

```bash
git diff origin/main | flutter pub run pull_request_coverage --maximum-uncovered-lines 5
```

Works with

Packages commonly used together with pull_request_coverage: ones it builds on, ones built on it, and its own family.