{"library":"diff-cover","title":"Diff-Cover","description":"Diff-Cover is a command-line tool that enhances code review by reporting test coverage and linting violations specifically on new or modified lines within a Git diff. It compares an XML coverage report (e.g., Cobertura, Clover, JaCoCo, or LCov format) with the output of `git diff` to highlight lines that lack test coverage or contain quality issues. The library is currently at version 10.2.0 and maintains an active release cadence with frequent updates and dependency bumps.","language":"python","status":"active","last_verified":"Sat Apr 11","install":{"commands":["pip install diff-cover","pip install diff-cover[flake8,mypy,pylint,ruff]"],"cli":{"name":"diff-cover","version":"diff-cover 10.2.0"}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"git init\n# Create some dummy files and commits for a diff\necho \"def func1():\\n    pass\" > file1.py\ngit add file1.py\ngit commit -m \"Initial commit\"\n\necho \"def func2():\\n    return 1 # new line\" >> file1.py\ngit add file1.py\ngit commit -m \"Add func2\"\n\n# Run your tests with coverage and generate an XML report\n# (Requires pytest-cov and pytest to be installed)\n# For a real project, this would run actual tests\npytest --cov=. --cov-report=xml --ignore=file1.py\n\n# Now, run diff-cover on the generated coverage.xml against the latest diff\n# This example might report 'No lines with coverage information in this diff.'\n# if the dummy coverage report doesn't perfectly align with the diff.\n# In a real scenario, `pytest --cov` would cover the changed lines.\ndiff-cover coverage.xml","lang":"bash","description":"This quickstart demonstrates the core functionality of `diff-cover`. First, ensure you have a Git repository and a `coverage.xml` report generated by a tool like `coverage.py` or `pytest-cov`. The `diff-cover` command then compares this report against your Git changes to identify uncovered or problematic lines in the diff.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]},"compatibility":null}