Conversation
…at_log_files_line Remove the dead `if unreadable < 0` branch from _format_log_files_line in vscode_report.py and its companion test test_inconsistent_counts_shown_when_parsed_exceeds_found. The invariant parsed <= found is guaranteed by construction in get_vscode_summary, so the branch can never execute. Closes #1001 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes a structurally unreachable “inconsistent counts” reporting branch from the VS Code summary renderer, aligning the output logic with the invariants enforced by get_vscode_summary.
Changes:
- Removed the dead
unreadable < 0branch in_format_log_files_lineand updated its docstring accordingly. - Deleted the unit test that exercised the impossible
parsed > foundstate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/copilot_usage/vscode_report.py |
Simplifies log-file count formatting by removing an unreachable “inconsistent counts” branch and updating the docstring. |
tests/copilot_usage/test_vscode_report.py |
Removes the test covering the unreachable branch, leaving coverage for the two reachable cases. |
There was a problem hiding this comment.
Low-impact dead code removal. The unreadable < 0 branch in _format_log_files_line is structurally unreachable because get_vscode_summary sets log_files_found=len(logs) and only increments log_files_parsed on success (line 767/789 of vscode_parser.py), guaranteeing parsed ≤ found. Removing the branch and its impossible-state test is correct. All CI checks pass. Auto-approving for merge.
Closes #1001
Changes
src/copilot_usage/vscode_report.pyif unreadable < 0:branch from_format_log_files_line. The invariantparsed ≤ foundis guaranteed by construction inget_vscode_summary(parsed starts at 0 and only increments on success, while found = len(logs)), sounreadablecan never be negative.tests/copilot_usage/test_vscode_report.pytest_inconsistent_counts_shown_when_parsed_exceeds_foundwhich tested this impossible state.Verification
test_unreadable_files_shown_when_found_exceeds_parsedandtest_happy_path_no_unreadable_annotation) still pass.make checkpasses cleanly: lint ✅, typecheck ✅, security ✅, unit tests (99% coverage) ✅, e2e tests (86 passed) ✅.