Refactor shared coverage reporter helpers - #19
AlexanderLanin wants to merge 2 commits into
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
Documentation preview for this pull request is available at: |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactor preserves existing behavior while establishing clear shared module boundaries and consistent build dependencies.
Review effort: Balanced
Findings: None
What changed in this PR
Refactors shared coverage logic into dedicated modules used by both reporting backends.
Changes:
- Extracts coverage file selection and source staging helpers.
- Updates reporter imports and Bazel dependencies.
- Redirects existing tests to the new modules.
| File | Description |
|---|---|
score_coverage/coverage_selection.py |
Adds shared file-selection helpers. |
score_coverage/coverage_sources.py |
Adds shared source-resolution and staging helpers. |
score_coverage/reporter.py |
Uses the extracted helpers. |
score_coverage/gcov_reporter.py |
Imports shared helpers directly. |
score_coverage/BUILD |
Defines and wires the new libraries. |
score_coverage/tests/reporter_test.py |
Updates helper imports. |
score_coverage/tests/BUILD |
Adds test dependencies for the new libraries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dcalavrezo-qorix
left a comment
There was a problem hiding this comment.
can only approve this refactor if some regression tests are executed on important repos like communication and baselibs
Why
Both coverage backends need to select in-scope source files and locate the source text used to render reports. Keeping these shared responsibilities in
reporter.pymakes their ownership harder to follow and couples the gcov backend to an LLVM-oriented module. This PR gives the shared code explicit modules that both backends can depend on directly.🦬🪒 Yak shaving
coverage_selection.py.coverage_sources.py, and import it directly from the gcov backend.