Wrap last column to terminal width in CLI table formatter#11829
Wrap last column to terminal width in CLI table formatter#11829Copilot wants to merge 13 commits into
Conversation
Agent-Logs-Url: https://github.com/radius-project/radius/sessions/0e0d575c-c4f7-4f21-9cae-42d9aa0dda88 Co-authored-by: zachcasper <30731731+zachcasper@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11829 +/- ##
==========================================
+ Coverage 51.74% 51.77% +0.03%
==========================================
Files 726 726
Lines 45605 45697 +92
==========================================
+ Hits 23597 23660 +63
- Misses 19788 19806 +18
- Partials 2220 2231 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes misaligned CLI table output by replacing the text/tabwriter-based table renderer with a custom renderer that can word-wrap the last column to the detected terminal width, keeping continuation lines aligned under the correct column.
Changes:
- Replaced the table output implementation with a manual renderer that computes column widths and wraps the last column when terminal width is known.
- Added tests validating last-column wrapping behavior (including unbreakable tokens) and no-wrap behavior when terminal width is unknown.
- Promoted
golang.org/x/term(andgithub.com/hashicorp/go-version) to direct dependencies ingo.mod.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/cli/output/table.go | New manual table renderer with terminal-width detection and last-column wrapping. |
| pkg/cli/output/table_test.go | Added unit tests covering wrapping/no-wrapping scenarios. |
| go.mod | Updated direct dependencies to include golang.org/x/term (and go-version). |
Agent-Logs-Url: https://github.com/radius-project/radius/sessions/e0470685-5721-4a91-b3e1-ac6fc8a2e1af Co-authored-by: zachcasper <30731731+zachcasper@users.noreply.github.com>
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
…failure The build was failing with "go: updates to go.mod needed; to update it: go mod tidy". The go.mod had duplicate entries for golang.org/x/term (v0.42.0 direct and v0.43.0 indirect) and a redundant direct require for github.com/hashicorp/go-version that was already in the main require block. Agent-Logs-Url: https://github.com/radius-project/radius/sessions/9f4270ed-d736-4423-8228-578856594aed Co-authored-by: zachcasper <30731731+zachcasper@users.noreply.github.com>
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
|
Closing, will resubmit a new PR. |
|
Replacement PR #11931 |
go.modinconsistency (duplicategolang.org/x/termentries and redundanthashicorp/go-versionrequire)go mod tidyto resolve module filemake buildsucceeds locally