---
name: "diff-cover"
section: "1"
platform: "linux"
package: "diff-cover"
version: "9.2.2-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/diff-cover"
---

# diff-cover(1)

find diff lines that need test coverage

## NAME

diff-cover - find diff lines that need test coverage

## DESCRIPTION

usage: diff-cover \[-h\] \[--html-report FILENAME\] \[--json-report FILENAME\]

-

  \[--markdown-report FILENAME\] \[--show-uncovered\] \[--expand-coverage-report\] \[--external-css-file FILENAME\] \[--compare-branch BRANCH\] \[--fail-under SCORE\] \[--ignore-staged\] \[--ignore-unstaged\] \[--include-untracked\] \[--exclude EXCLUDE \[EXCLUDE ...\]\] \[--include INCLUDE \[INCLUDE ...\]\] \[--src-roots DIRECTORY \[DIRECTORY ...\]\] \[--diff-range-notation RANGE\_NOTATION\] \[--version\] \[--ignore-whitespace\] \[-q\] \[-c CONFIG\_FILE\] \[--diff-file DIFF\_FILE\] coverage\_file \[coverage\_file ...\]

Automatically find diff lines that need test coverage.

### positional arguments:

- coverage\_file

  coverage report (XML or lcov.info)

### options:

- **-h**, **--help**

  show this help message and exit

- **--html-report** FILENAME

  Diff coverage HTML output

- **--json-report** FILENAME

  Diff coverage JSON output

- **--markdown-report** FILENAME

  Diff coverage Markdown output

- **--show-uncovered**

  Show uncovered lines on the console

- **--expand-coverage-report**

  Append missing lines in coverage reports based on the hits of the previous line.

- **--external-css-file** FILENAME

  Write CSS into an external file

- **--compare-branch** BRANCH

  Branch to compare

- **--fail-under** SCORE

  Returns an error code if coverage or quality score is below this value

- **--ignore-staged**

  Ignores staged changes

- **--ignore-unstaged**

  Ignores unstaged changes

- **--include-untracked**

  Include untracked files

- **--exclude** EXCLUDE \[EXCLUDE ...\]

  Exclude files, more patterns supported

- **--include** INCLUDE \[INCLUDE ...\]

  Files to include (glob pattern)

- **--src-roots** DIRECTORY \[DIRECTORY ...\]

  List of source directories (only for jacoco coverage reports)

- **--diff-range-notation** RANGE\_NOTATION

  Git diff range notation to use when comparing branches, defaults to '...'

- **--version**

  show program's version number and exit

- **--ignore-whitespace**

  When getting a diff ignore any and all whitespace

- **-q**, **--quiet**

  Only print errors and failures

- **-c**, **--config-file** CONFIG\_FILE

  The configuration file to use

- **--diff-file** DIFF\_FILE

  The diff file to use
