1027 omissions in messages for usethis init backend=none#1049
1027 omissions in messages for usethis init backend=none#1049nathanjmcdougall merged 4 commits intomainfrom
Conversation
… --backend=none` Split `box_print` into `how_print` and `instruct_print` with dedicated, distinguished handling in `usethis_config`
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1049 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors console output messaging to differentiate between instructional messages (that users must act on) and informational "how-to" messages. The key changes introduce two new print functions (instruct_print and how_print) to replace the generic box_print, along with a new instruct_only configuration flag that allows selective suppression of output while preserving critical user instructions.
- Replaces
box_printwith semantically distinctinstruct_print(for required actions) andhow_print(for usage guidance) - Adds
instruct_onlyconfiguration mode to show only instructions, warnings, and errors - Updates output suppression logic across all print functions to respect the new
instruct_onlyflag
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/usethis/_console.py | Adds instruct_print and how_print functions, removes box_print, updates all print functions to check instruct_only flag |
| src/usethis/_config.py | Adds instruct_only field to UsethisConfig class and context manager support |
| src/usethis/_ui/interface/init.py | Refactors init function to extract logic into _init, uses instruct_only mode instead of alert_only |
| src/usethis/_init.py | Updates to use instruct_only mode when initializing projects with backend=none |
| src/usethis/_deps.py | Replaces box_print with instruct_print for dependency management instructions |
| src/usethis/_core/tool.py | Replaces box_print with instruct_print for pre-commit installation instructions |
| src/usethis/_core/readme.py | Replaces box_print with how_print for README population guidance |
| src/usethis/_core/ci.py | Replaces box_print with how_print for CI usage instructions |
| src/usethis/_core/browse.py | Replaces box_print with how_print for URL opening instructions |
| src/usethis/_tool/base.py | Updates config adding logic to respect instruct_only flag |
| src/usethis/_tool/impl/*.py | Replaces box_print with how_print or instruct_print across all tool implementations |
| src/usethis/_integrations/pytest/core.py | Replaces box_print with instruct_print for pytest directory reconfiguration |
| src/usethis/_integrations/pre_commit/*.py | Replaces box_print with instruct_print for pre-commit setup instructions |
| src/usethis/_integrations/ci/bitbucket/steps.py | Replaces box_print with instruct_print for pipeline step instructions |
| tests/usethis/test_console.py | Adds tests for instruct_print, how_print, and instruct_only suppression behavior |
| tests/usethis/_ui/interface/test_init.py | Updates expected output to include new instructional messages for dependency additions |
| tests/usethis/_tool/test_base.py | Updates test mocks from box_print to how_print |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.