Skip to content

Comments

Open Source Project Pull Request#2695

Closed
cdandeneau wants to merge 1 commit intobeeware:mainfrom
cdandeneau:calebopensource
Closed

Open Source Project Pull Request#2695
cdandeneau wants to merge 1 commit intobeeware:mainfrom
cdandeneau:calebopensource

Conversation

@cdandeneau
Copy link

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

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.
@cdandeneau cdandeneau closed this Feb 17, 2026
@cdandeneau cdandeneau deleted the calebopensource branch February 17, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant