feat!: add no_truncate opt-out for table columns in human output#40
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a TableColumn::no_truncate(bool) opt-out to preserve long values (e.g., URLs) in human table output by removing the existing 40-character width cap for opted-out columns, and introduces regression tests to prevent truncation regressions.
Changes:
- Extend
TableColumnwith ano_truncateflag and builder method. - Update the human table renderer to compute widths without the 40-char cap when
no_truncateis enabled. - Update existing tests for the new
TableColumnfield and add new regression tests for long, untruncated values.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/output/human.rs | Adds no_truncate to TableColumn and updates table width calculation + unit regression test. |
| tests/exhaustive_output.rs | Adds an integration-style regression test ensuring long URLs are preserved in human table output. |
| tests/foundation.rs | Updates expected TableColumn struct literals to include the new no_truncate field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Table output truncates any column value over 40 characters, which makes URL-bearing columns (e.g. godaddy-cli's `domain agreements`) unusable. Adds a `TableColumn::no_truncate` builder flag so callers can exempt specific columns from the width cap, bounded by a much higher NO_TRUNCATE_MAX_WIDTH to avoid unbounded padding for pathological values. BREAKING CHANGE: TableColumn gains a new public field (no_truncate). Since all of TableColumn's fields are public, this breaks any downstream code constructing it via an exhaustive struct literal instead of TableColumn::new(...)/the builder methods.
2a57c34 to
fbfc6d1
Compare
TableColumn::no_truncate and its rustdoc said values are "never truncated", but the renderer still caps them at NO_TRUNCATE_MAX_WIDTH. Reword to avoid downstream consumers assuming truly unbounded output.
widths[index] was seeded from the header length but then clamped by .min(40)/.min(NO_TRUNCATE_MAX_WIDTH), which could push it below the header's own length for an unusually long header. render_table never truncates headers (only pads), so that column's header would overflow past the padded separator/row cells, breaking table alignment.
The cap is applied before the header-length floor, so an (unrealistic) header exceeding the cap is never truncated or misaligned. Document this precedence explicitly rather than reordering, which would reintroduce the header-overflow bug this cap's neighbor fix addressed.
axburgess-godaddy
approved these changes
Jul 7, 2026
jpage-godaddy
pushed a commit
that referenced
this pull request
Jul 7, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.0](cli-engine-v0.3.5...cli-engine-v0.4.0) (2026-07-07) ### ⚠ BREAKING CHANGES * add no_truncate opt-out for table columns in human output ([#40](#40)) ### Features * add no_truncate opt-out for table columns in human output ([#40](#40)) ([4adb998](4adb998)) * render guide markdown for human output with termimad ([#38](#38)) ([d4d8383](d4d8383)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@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.
Summary
TableColumn::no_truncate(bool), a builder flag that exempts a column from the human-output table renderer's 40-char width cap.domain agreementstruncating URLs in table output (unrelated caller-side fix will follow once this is published).no_truncatecolumns are still bounded by a much higherNO_TRUNCATE_MAX_WIDTH(4096 chars) rather than being fully unbounded, so a pathologically long field value can't blow up table width/memory. Header length always takes precedence over this cap, so a column header is never truncated or misaligned even in the unrealistic case it exceeds it.Breaking change
TableColumngains a new public field (no_truncate). All ofTableColumn's fields are public, so this breaks any downstream code constructing it via an exhaustive struct literal instead ofTableColumn::new(...)+ builder methods. Markedfeat!:/BREAKING CHANGE:so release-please bumps the minor version per this project's pre-1.0 versioning rules (CONTRIBUTING.md).Test plan
cargo test— all unit, integration, and doc tests pass, including new regression tests (no_truncate_column_keeps_long_values_intact,no_truncate_column_still_caps_pathologically_long_values,column_width_never_shrinks_below_a_long_header,human_view_no_truncate_column_preserves_long_values_in_table_output)cargo clippy --all-targets -- -D warnings— cleancargo fmt --check— clean[patch.crates-io]override that a.with_viewcolumn with.no_truncate(true)renders a full untruncated URLexec_providertest unrelated to this diff (confirmed by rerun)🤖 Generated with Claude Code