Skip to content

fix: README structure and code quality nits#40

Merged
microsasa merged 3 commits intomainfrom
fix/docs-and-nits
Mar 14, 2026
Merged

fix: README structure and code quality nits#40
microsasa merged 3 commits intomainfrom
fix/docs-and-nits

Conversation

@microsasa
Copy link
Owner

Closes #21
Closes #23

Changes

Issue #21 — README project structure wrong path

  • Updated project structure diagram to show docs/ under src/copilot_usage/ and top-level docs/ with only changelog.md

Issue #23 — Code quality nit bundle

  1. models.py: Replaced verbose default_factory=lambda: list[dict[str, object]]() with idiomatic default_factory=list
  2. parser.py: Removed model_token_map intermediate dict; build active_metrics directly
  3. cli.py + report.py: Delegated cost command date filtering to render_cost_view via _filter_sessions instead of inline reimplementation

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 only docs/changelog.md at the repo root.
  • Simplify build_session_summary active-session metrics construction by removing an unnecessary intermediate dict.
  • Move cost view date filtering into render_cost_view and delegate filtering from the cost CLI 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.

Sasa Junuzovic and others added 2 commits March 14, 2026 11:49
- 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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa microsasa merged commit 226765c into main Mar 14, 2026
4 checks passed
@microsasa microsasa deleted the fix/docs-and-nits branch March 16, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants