Skip to content

fix(cli): keep verbose stats file paths on one row - #73

Merged
knight22-21 merged 2 commits into
knight22-21:mainfrom
sundaysebasidian-byte:fix/stats-paths-17
Oct 10, 2026
Merged

knight22-21 merged 2 commits into
knight22-21:mainfrom
sundaysebasidian-byte:fix/stats-paths-17

Conversation

@sundaysebasidian-byte

@sundaysebasidian-byte sundaysebasidian-byte commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #17.

stats --verbose currently includes the full absolute project prefix in every Path cell. Deep project directories make the table wrap each file across multiple rows. Display project-relative paths, cap the Path column at 60 characters, and render paths as single-line text with ellipsis while allowing that column to shrink on narrow terminals. Paths outside the project root fall back to their original display instead of failing.

Added regression tests that build real temporary Python project indexes and query real SQLite storage. They cover absolute/relative project arguments, distinct same-named files, 80/120-column terminals, very long paths containing spaces, and an out-of-root stored record. Updated the changelog for the user-visible fix.

Validation after syncing main 6ee2ff6251af85f32dce90320b5ed956b98b1fa3, on macOS with the existing Python 3.14.6 development environment:

  • Original pre-fix baseline, before subsequent main updates: 729 passed, 1 skipped.
  • The original rendering failed the new in-root regression cases.
  • Focused CLI tests after syncing main: 64 passed.
  • Full suite after syncing main: 771 passed, 1 skipped; total coverage 89.13% (80% requirement).
  • Repository-wide ruff check and ruff format --check passed.
  • The new test file passes mypy (--follow-imports=silent); CLI diagnostics were compared with the same check on current main. The touched CLI module retains the same 19 pre-existing mypy diagnostics as upstream after normalizing line offsets; no new diagnostics were introduced.
  • Independent review of the final diff found no blocking issues.

Checklist:

  • Tests added for the changed verbose-table behavior.
  • ruff check and ruff format --check pass.
  • No new mypy diagnostics in touched files.
  • All existing tests pass (one existing skip).
  • No new public functions; new test helpers have docstrings.
  • docs/changelog.md updated.

AI assistance: implementation and tests were prepared with Codex and reviewed by a separate Codex agent. No dependencies were added or installed for this change. Python 3.12/3.13 and other operating systems were not run locally; those CI results must be assessed separately. Symlink normalization was checked against the indexer's existing root-resolution code but was not given a dedicated end-to-end test.

@sundaysebasidian-byte
sundaysebasidian-byte marked this pull request as ready for review October 3, 2026 14:53

@knight22-21 knight22-21 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM! Clean handling of project-relative paths and table formatting to keep rows compact on deep trees, with solid test coverage.

@knight22-21
knight22-21 merged commit 4414cc8 into knight22-21:main Oct 10, 2026
4 checks passed
@knight22-21

Copy link
Copy Markdown
Owner

Merged, thank you @sundaysebasidian-byte! This keeps file paths in \stats --verbose\ readable on deep directory structures without unwanted line wrapping. If CodePrism is useful to you, a star on the repo helps others find it. Would love to see more PRs from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stats --verbose: absolute paths make the table unreadable on deep directory trees

2 participants