← Back to issue list

CraftError messages with new lines render inconsistently

View original Github issue

Metadata

Project
craft-cli
Number
#269
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

CraftError messages containing new lines render with extraneous whitespace between the message and resolution sections. A maintainer commented that PR #210 (remove trailing spaces) likely fixes this indirectly.

Suggested action: keep open

Reason: A maintainer (lengau) acknowledged the bug on 2024-08-28 and indicated that PR #210 ('fix: remove trailing spaces where supported', merged) likely fixes this indirectly since it no longer uses spaces to fill the line. The issue has been triaged with a maintainer response and a linked fix, so it should remain open pending verification that the fix actually resolves the rendering inconsistency.

Impact: 30 Quick Win: 22.5 Staleness: 55 Complexity: 25 Confidence: 70 Support Request: 5

Issue body

### Bug Description If the `message` field in a `CraftError` contains a new line, craft-cli appears to append whitespace, which causes the appearance of a new line between the `message` and `resolution` sections. Note that I cannot use the `details` field because `details` isn't visible at the default `brief` verbosity level. ### To Reproduce ```diff diff --git a/examples.py b/examples.py index c842a1a..c7fe76e 100755 --- a/examples.py +++ b/examples.py def example_10(): @@ -513,6 +516,15 @@ def example_30(): time.sleep(0.001) +def example_31(): + """Show an error.""" + path = "/dev/null" + raise CraftError( + message="Remote build does not support building multiple snaps on the same architecture:\n - Building on 'amd64' will create snaps for 'amd64' and 'riscv64'.", + resolution="this is the resolution", + ) + + # -- end of test cases if len(sys.argv) < 2: ``` ### part yaml _No response_ ### Relevant log output See the attached pictures. The same photo is highlighted to show what appears to be extraneous whitespace. ![Screenshot_20240827_164350](https://github.com/user-attachments/assets/0d4690da-28b6-48c5-91d0-fd642bde3a7b) ![Screenshot_20240827_164359](https://github.com/user-attachments/assets/902c95ea-caf6-442f-a487-d5aea5497eaf)

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 22.5
Staleness: 55
Complexity: 25
Confidence: 70
Support Request: 5
keep open CraftError messages containing new lines render with extraneous whitespace between the message and resolution sections. A maintainer commented that PR #210 (remove trailing spaces) likely fixes this indirectly.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 20
Confidence: 85
Support Request: 0
keep open Bug report about CraftError messages with new lines rendering inconsistently due to whitespace appending. Issue is 693 days old, last activity 498 days ago. A maintainer acknowledged it and linked a potential fix in PR #210.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 20
Confidence: 85
Support Request: 5
close stale Bug report about inconsistent rendering of CraftError messages containing newlines, causing extra whitespace between message and resolution sections. Inactive for over a year; a maintainer suggested a related PR may have fixed it.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 70
Support Request: 5
close stale craft-cli adds unwanted whitespace between error messages and resolutions when CraftError messages contain newlines. A contributor suggests PR #210 may resolve it. Issue remains open and awaiting triage.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-cli#210 (confidence 75%)

    Maintainer lengau commented: 'I'm pretty sure that #210 indirectly fixes this (since it doesn't use spaces to fill the line).' PR #210 was merged with title 'fix: remove trailing spaces where supported'.

Related issues

No related issues found above the similarity threshold.