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.
Member
|
Thanks for the PR, but I'm going to close this. Firstly - there's an existing PR in flight for this issue (#2563) that is nearing completion. The discussion history of #2559 points this out. It would not be fair to the original contributor to void their work by accepting this PR. Secondly - the implementation has some interesting choices, including the introduction of a submodule for no obvious reason. Lastly - it has included an empty changenote. That's not what our contribution guide requests. I have reason to suspect that this PR has been generated with the assistance of an LLM. We don't prohibit the use of LLMs, but we do ask that you declare when they are used so that we are able to make an assessment on the provenance of the code. |
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.
Summary
This PR introduces a reusable helper for formatting boxed console messages and migrates the JAVA_HOME warnings in the Java integration to use it.
What changed
Added
format_message_box(message, title=None)inbriefcase.consoleto:*-border boxes,Replaced two manually aligned triple-quoted warning blocks in
JDK.verify_install()withformat_message_box():Added tests for the helper to verify:
Why
This avoids brittle hand-spacing in warning strings, keeps surrounding code indentation clean, and makes variable-content warnings (like Java versions/paths) format correctly without manual padding.
Testing
ruff check src/briefcase/console.py src/briefcase/integrations/java.py tests/console/test_format_message_box.pypytest -q tests/console/test_format_message_box.pypytest -q tests/integrations/java/test_JDK__verify.pyIssue
Fixes #2559.