Skip to content

fix: stop padding rows to widest filename#113

Merged
seapagan merged 2 commits intomainfrom
fix/issue-58-table-wrap
Apr 4, 2026
Merged

fix: stop padding rows to widest filename#113
seapagan merged 2 commits intomainfrom
fix/issue-58-table-wrap

Conversation

@seapagan
Copy link
Copy Markdown
Owner

@seapagan seapagan commented Apr 4, 2026

This closes #58.

The change removes the fake right-hand space border from the shared prettytable format while keeping the existing left margin. That stops prettytable from padding the final column in every row to the width of the longest filename.

The underlying bug was that one oversized filename made every row wide enough to wrap at the terminal edge, which is why long and short listings both looked double-spaced. With the trailing border removed, genuinely long rows still wrap, but shorter rows stay single-spaced like native ls.

The PR also adds renderer and integration regressions for both long and short output so the padding behavior does not come back.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Refined table border formatting to improve visual consistency in output display.
  • Tests

    • Enhanced test coverage to validate filename column alignment when displaying files of varying name lengths, ensuring consistent formatting across both long and short format listing modes without unnecessary padding.

Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 4, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 4 duplication

Metric Results
Complexity 0
Duplication 4

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@seapagan seapagan self-assigned this Apr 4, 2026
@seapagan seapagan added the bug Something isn't working label Apr 4, 2026
@seapagan seapagan marked this pull request as ready for review April 4, 2026 10:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Warning

Rate limit exceeded

@seapagan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 34 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 13 minutes and 34 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f7b90f16-2a95-4561-bb6c-7ef85481775e

📥 Commits

Reviewing files that changed from the base of the PR and between 061ff21 and f6666cb.

📒 Files selected for processing (1)
  • TODO.md
📝 Walkthrough

Walkthrough

Modified table border rendering configuration from generic borders to left border in the table utility. Added unit and integration tests to verify that filename rows with varying lengths are not automatically padded to match the longest filename in the table.

Changes

Cohort / File(s) Summary
Table Configuration
src/utils/table.rs
Changed borders(' ') to left_border(' ') in create_table() function, altering the left border character rendering behaviour of the PrettyTable format.
Test Coverage
tests/crate/render.rs, tests/integration.rs
Added four new unit and integration tests validating that filename rows maintain their original length without being padded to the width of the longest filename in both long-format (-l) and short-format listing modes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A table with borders, now left-aligned,
Filenames short, perfectly defined—
No padding, no stretching, just right,
Tests catch the bugs before they bite!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: removing row padding to the widest filename, which is the primary fix implemented across the codebase modifications.
Linked Issues check ✅ Passed The PR addresses the first part of issue #58 by fixing the double-spacing bug caused by table padding, allowing other rows to wrap normally without affecting table cell height.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the padding issue: the PrettyTable border configuration change and the regression tests validating the fix for both long and short formats.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-58-table-wrap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Grant Ramsay <seapagan@gmail.com>
@seapagan seapagan merged commit 46bda7f into main Apr 4, 2026
5 checks passed
@seapagan seapagan deleted the fix/issue-58-table-wrap branch April 4, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shorten huge filenames if they are going to cause wrapping on the long or short listing.

1 participant