fix: README structure and code quality nits#40
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses two repo health issues: it corrects the README’s project structure diagram to match the actual docs layout, and it applies a small set of code-quality refactors in copilot_usage (simplifying active-session metric construction and centralizing date filtering for the cost view).
Changes:
- Update README project structure to show developer docs under
src/copilot_usage/docs/and onlydocs/changelog.mdat the repo root. - Simplify
build_session_summaryactive-session metrics construction by removing an unnecessary intermediate dict. - Move cost view date filtering into
render_cost_viewand delegate filtering from thecostCLI command.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/copilot_usage/report.py |
Adds since/until parameters to render_cost_view and applies _filter_sessions internally. |
src/copilot_usage/parser.py |
Removes model_token_map indirection; builds active_metrics directly. |
src/copilot_usage/cli.py |
Removes inline date filtering in cost; delegates to render_cost_view via since/until params. |
README.md |
Fixes project structure diagram to reflect actual docs locations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update project structure diagram to show docs/ under src/copilot_usage/ instead of top-level (fixes #21) - Replace verbose lambda default_factory with default_factory=list in models.py toolRequests field - Remove model_token_map indirection in parser.py build_session_summary; build active_metrics directly - Delegate cost command date filtering to render_cost_view via _filter_sessions instead of inline reimplementation Closes #21 Closes #23 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot review: new since/until params on render_cost_view had no test coverage. Added test verifying sessions outside range are excluded. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4f85364 to
ded1d3e
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Closes #21
Closes #23
Changes
Issue #21 — README project structure wrong path
docs/undersrc/copilot_usage/and top-leveldocs/with onlychangelog.mdIssue #23 — Code quality nit bundle
models.py: Replaced verbosedefault_factory=lambda: list[dict[str, object]]()with idiomaticdefault_factory=listparser.py: Removedmodel_token_mapintermediate dict; buildactive_metricsdirectlycli.py+report.py: Delegated cost command date filtering torender_cost_viewvia_filter_sessionsinstead of inline reimplementation