Skip to content

Add first-party line wrapping#17535

Merged
zanieb merged 1 commit into
mainfrom
zb/vendor-line-wrap
May 27, 2026
Merged

Add first-party line wrapping#17535
zanieb merged 1 commit into
mainfrom
zb/vendor-line-wrap

Conversation

@zanieb

@zanieb zanieb commented Jan 16, 2026

Copy link
Copy Markdown
Member

Required for #17110 to avoid regressions where miette previously wrapped lines in error messages.

@zanieb zanieb changed the title zb/vendor line wrap Add first-party line wrapping Jan 16, 2026
@zanieb zanieb force-pushed the zb/miette-remove-ii branch from 73b9b0c to 9d91a8e Compare January 16, 2026 18:46
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch 3 times, most recently from 1fda928 to 700da71 Compare January 16, 2026 19:31
@zanieb zanieb temporarily deployed to uv-test-publish January 16, 2026 19:34 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from 700da71 to b75af41 Compare January 16, 2026 19:46
@zanieb zanieb temporarily deployed to uv-test-publish January 16, 2026 19:50 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/miette-remove-ii branch from d5cced1 to 8005bd5 Compare January 16, 2026 19:52
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from b75af41 to 4404fd5 Compare January 16, 2026 20:18
@zanieb zanieb temporarily deployed to uv-test-publish January 16, 2026 20:25 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/miette-remove-ii branch from 8005bd5 to fe700e0 Compare January 16, 2026 20:34
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from 4404fd5 to 70ca654 Compare January 16, 2026 20:34
@zanieb zanieb temporarily deployed to uv-test-publish January 16, 2026 20:39 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from 70ca654 to ca11d5d Compare January 16, 2026 21:09
@zanieb zanieb temporarily deployed to uv-test-publish January 16, 2026 21:13 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/miette-remove-ii branch 3 times, most recently from 3932c28 to 66db1a1 Compare January 17, 2026 17:23
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from ca11d5d to d6ab7de Compare January 17, 2026 17:23
@zanieb zanieb temporarily deployed to uv-test-publish January 17, 2026 17:27 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from d6ab7de to 3bd3af1 Compare March 16, 2026 18:50
@zanieb zanieb changed the base branch from zb/miette-remove-ii to zb/hint March 16, 2026 23:48
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
Base automatically changed from zb/hint to main May 20, 2026 17:43
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from 3bd3af1 to ffc265c Compare May 20, 2026 17:56
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch 4 times, most recently from da76a07 to 56d0d9b Compare May 20, 2026 18:48
@astral-sh-bot

astral-sh-bot Bot commented May 20, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the latest main baseline.

  • Added tests: 9
  • Removed tests: 1
  • Changed suites: 2
uv-errors: +9 / -0

Added:

  • uv-errors::tests::format_multiline_message
  • uv-errors::tests::format_with_hints
  • uv-errors::tests::test_error_chain_with_cause
  • uv-errors::tests::test_error_wrapping_with_columns
  • uv-errors::tests::test_long_words_not_broken
  • uv-errors::tests::test_multiline_main_message_wraps_each_line
  • uv-errors::tests::test_multiple_error_sources
  • uv-errors::tests::test_no_hyphenation
  • uv-errors::tests::test_wrap_only_on_ascii_space

Removed: none

uv-warnings: +0 / -1

Added: none

Removed:

  • uv-warnings::tests::format_multiline_message

@zanieb zanieb force-pushed the zb/vendor-line-wrap branch 4 times, most recently from 6fa7ff1 to 29f5065 Compare May 27, 2026 16:47
Comment thread crates/uv-dev/src/main.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch 2 times, most recently from 35716d3 to eb705af Compare May 27, 2026 17:59
Comment thread crates/uv-errors/src/lib.rs Outdated
Comment thread crates/uv-errors/src/lib.rs Outdated
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch 2 times, most recently from 7d0e5a3 to 2d1f908 Compare May 27, 2026 18:09
Add textwrap-based line wrapping for error and warning output, replacing
the line wrapping previously provided by miette.

- Add `write_error_chain` to `uv-errors` with terminal-width-aware wrapping
  and explicit `Hints`
- Use the shared formatter for the CLI error exit path and direct chain emitters
- Support `UV_NO_WRAP` env var to disable wrapping
- Support `COLUMNS` env var and terminal size detection for wrap width
- Words are never broken or hyphenated (URLs, package names stay intact)
- Remove the old `write_error_chain` implementation from `uv-warnings`
@zanieb zanieb force-pushed the zb/vendor-line-wrap branch from 2d1f908 to e1522cf Compare May 27, 2026 18:19
@zanieb zanieb marked this pull request as ready for review May 27, 2026 18:58
@zanieb zanieb added the internal A refactor or improvement that is not user-facing label May 27, 2026
@zanieb zanieb merged commit b1e02c5 into main May 27, 2026
223 of 224 checks passed
@zanieb zanieb deleted the zb/vendor-line-wrap branch May 27, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant