Disable hard-wrapping for all console print functions#1656
Merged
nathanjmcdougall merged 5 commits intomainfrom Mar 31, 2026
Merged
Disable hard-wrapping for all console print functions#1656nathanjmcdougall merged 5 commits intomainfrom
nathanjmcdougall merged 5 commits intomainfrom
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
Collaborator
|
@copilot please fix failing tests Details |
Update test assertions in test_core_tool.py, test_deps.py, test_pyproject_toml.py, and test_tool.py to expect unwrapped output now that all console print functions use soft_wrap=True. Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/d4c365e2-612d-4c4d-86ad-7b5a4c95ed87 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Contributor
Author
... Fixed in c1a3c0b. There were 10 additional tests across 4 files that had hard-wrapped output expectations embedded in their assertions (e.g., embedded |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
soft_wrap=Trueto allconsole.print()calls in_console.py(tick_print,instruct_print,how_print,info_print,err_print,warn_print).replace("\n", "")workarounds intests/usethis/_core/test_core_tool.py(7 instances).replace("\n", "")workarounds intests/usethis/_ui/interface/test_rule.py(2 instances).replace("\n", "")workarounds intests/usethis/_ui/interface/test_lint.py(2 instances).replace("\n", " ")workaround intests/usethis/_tool/test_base.py(1 instance)test_no_line_wrappingtests intest_console.pyfor tick_print, instruct_print, info_print, err_print, warn_printtest_core_tool.py: 6 assertions with embedded\nwrapping in dependency/rule messagestest_deps.py: 1 assertion with embedded\nwrappingtest_pyproject_toml.py: 1 assertion with embedded\nwrapping in warning messagetest_tool.py: 2 assertions with embedded\nwrapping (pyproject.toml how, ruff readme example)Skills used:
usethis-qa-static-checksResolves #1751