Open
Conversation
Implements generating coverage reporting in LCOV format, controlled by the flag `--lcov`. Changes: - Added lcovreport.py module with LcovReporter class for generating LCOV format output - Integrated LCOV reporting into slipcover.py with print_lcov() function - Added --lcov command-line flag to __main__.py for selecting LCOV output - Added --lcov-test-name and --lcov-comment, common in other LCOV tools - Exported print_lcov in __init__.py to make it accessible - Added tests for LCOV reporting (with and without branches) The LCOV format includes: - TN: Test name (optional) - SF: Source file path - BRDA: Branch coverage data (when --branch is used) - BRF/BRH: Branch statistics - DA: Line coverage data - LF/LH: Line statistics - end_of_record marker Usage examples: python -m slipcover --lcov --out coverage.lcov script.py python -m slipcover --branch --lcov --out coverage.lcov script.py
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements LCOV format coverage reporting for slipcover, enabling output compatible with tools that consume LCOV format. The implementation adds a new LcovReporter class and integrates it into the CLI with --lcov flag support, along with optional test name and comment features.
Changes:
- Added LCOV format reporting with line and branch coverage support
- Integrated LCOV output option into CLI with
--lcov,--lcov-test-name, and--lcov-commentflags - Added comprehensive test coverage for LCOV functionality including branches, test names, and comments
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/slipcover/lcovreport.py | New module implementing LCOV format reporter with line and branch coverage |
| src/slipcover/slipcover.py | Added print_lcov() function to expose LCOV reporting API |
| src/slipcover/main.py | Integrated LCOV CLI flags and output handling in both merge and normal execution modes |
| src/slipcover/init.py | Exported print_lcov in public API |
| tests/test_coverage.py | Added test suite for LCOV reporting covering various scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
@emeryberger addressed Copilot's findings and merged updated main. ptal! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements generating coverage reporting in LCOV format, controlled by the flag
--lcov.Changes:
lcovreport.pymodule withLcovReporterclass for generating LCOV format outputslipcover.pywithprint_lcov()function--lcovcommand-line flag to__main__.pyfor selecting LCOV output--lcov-test-nameand--lcov-comment, common in other LCOV toolsThe LCOV format includes:
Usage examples: