Closed
Conversation
Fix inconsistent indentation and fragile hand-aligned triple-quoted warning blocks by centralizing boxed message formatting. Make it easier to construct warning text with variable content (e.g. Java version strings) without manual spacing hacks. Description Add format_message_box(message, title=None) to briefcase.console to produce star-bordered boxed messages with consistent border width, optional title, and wrapped/indented body text. Replace two JAVA_HOME warning branches in JDK.verify_install() (wrong major version and JAVA_HOME does not point to a JDK) to use format_message_box() instead of large triple-quoted strings. Add unit tests for the helper in tests/console/test_format_message_box.py to validate title alignment and content wrapping. Testing python -m compileall on modified files succeeded. ruff checks on src/briefcase/console.py, src/briefcase/integrations/java.py, and the new test file passed. pytest runs were attempted; running the integration test set was blocked by the test environment lacking project package metadata and a test dependency (httpx_retries), so full pytest validation could not be completed in this environment. The changes are intentionally applied to a subset of warning sites (Java integration) to demonstrate the helper; further conversions can follow in subsequent PRs.
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.
Motivation
Fix inconsistent indentation and fragile hand-aligned triple-quoted warning blocks by centralizing boxed message formatting. Make it easier to construct warning text with variable content (e.g. Java version strings) without manual spacing hacks.
Description
Add format_message_box(message, title=None) to briefcase.console to produce star-bordered boxed messages with consistent border width, optional title, and wrapped/indented body text. Replace two JAVA_HOME warning branches in JDK.verify_install() (wrong major version and JAVA_HOME does not point to a JDK) to use format_message_box() instead of large triple-quoted strings. Add unit tests for the helper in tests/console/test_format_message_box.py to validate title alignment and content wrapping.
### Testing
python -m compileall on modified files succeeded.
ruff checks on src/briefcase/console.py, src/briefcase/integrations/java.py, and the new test file passed. pytest runs were attempted; running the integration test set was blocked by the test environment lacking project package metadata and a test dependency (httpx_retries), so full pytest validation could not be completed in this environment. The changes are intentionally applied to a subset of warning sites (Java integration) to demonstrate the helper; further conversions can follow in subsequent PRs.
This Fixes issue #2559