Disable hard-wrapping for all console print functions#1656
Open
Disable hard-wrapping for all console print functions#1656
Conversation
…karounds
- Add soft_wrap=True to tick_print, instruct_print, how_print, info_print,
err_print, and warn_print (via _cached_warn_print) in _console.py
- Remove .replace("\n", "") workarounds from test_core_tool.py (7 instances)
- Remove .replace("\n", "") workarounds from test_rule.py (2 instances)
- Remove .replace("\n", "") workarounds from test_lint.py (2 instances)
- Remove .replace("\n", " ").replace(" ", " ") workaround from test_base.py
- Add test_no_line_wrapping tests for tick_print, instruct_print, info_print,
err_print, and warn_print in test_console.py
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/83ad3589-83a9-4f1f-8e8c-bacca08c9660
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/83ad3589-83a9-4f1f-8e8c-bacca08c9660 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with hard-wrapping in commands
Disable hard-wrapping for all console print functions
Mar 30, 2026
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.
Most styled print functions (
tick_print,instruct_print,how_print,info_print,err_print,warn_print) lackedsoft_wrap=Trueon their Richconsole.print()calls, causing hard-wrapping at terminal width. Tests worked around this with.replace("\n", "")hacks.Changes
src/usethis/_console.py: Addedsoft_wrap=Trueto all 6 affectedconsole.print()calls, matchingplain_print()andtable_print()which already had it:.replace("\n", "")and.replace("\n", " ").replace(" ", " ")hacks with exact==assertions using proper\nterminatorstests/usethis/test_console.py: Addedtest_no_line_wrappingfor each styled print function, verifying 200-char messages aren't wrappeddocs/functions.txt,AGENTS.md: Auto-generated sync from prek hooks (pre-existing gap, unrelated)