--- id: diff-cover version: "10.5.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # diff-cover — Run coverage and linting reports on diffs License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install diff-cover uv add diff-cover poetry add diff-cover ## Description diff-cover |pypi-version| |conda-version| |build-status| ======================================================================================== Automatically find diff lines that need test coverage. Also finds diff lines that have violations (according to tools such as pycodestyle, pyflakes, flake8, or pylint). This is used as a code quality metric during code reviews. Overview -------- Diff coverage is the percentage of new or modified lines that are covered by tests. This provides a clear and achievable standard for code review: If you touch a line of code, that line should be covered. Code coverage is *every* developer's responsibility! The ``diff-cover`` command line tool compares an XML coverage report with the output of ``git diff``. It then reports coverage information for lines in the diff. Currently, ``diff-cover`` requires that: - You are using ``git`` for version control. - Your test runner generates coverage reports in Cobertura, Clover or JaCoCo XML format, or LCov format. Supported XML or LCov coverage reports can be generated with many coverage tools, including: - Cobertura__ (Java) - Clover__ (Java) - JaCoCo__ (Java) - coverage.py__ (Python) -... ## AI interpretation — verify before relying Compares test coverage and code quality reports against git diffs to measure coverage on only the lines you changed, supporting multiple coverage formats (Cobertura, Clover, JaCoCo, LCov) and quality checkers (pycodestyle, flake8, pylint, ruff). Verdict: Production-stable tool for enforcing test coverage on code changes during review. Actively maintained, permissive license, low install friction, and no known vulnerabilities. Supports Python 3.10–3.14 and integrates with standard coverage and linting tools. [View on SkillFed](https://skillfed.io/packages/diff-cover) · [View on PyPI](https://pypi.org/project/diff-cover/)