Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix lipgloss padding on long CLI error messages#2332

Open
holyfuchs wants to merge 1 commit intomasteronflow/flow-cli:masterfrom
holyfuchs/improve-test-error-outputonflow/flow-cli:holyfuchs/improve-test-error-outputCopy head branch name to clipboard
Open

Fix lipgloss padding on long CLI error messages#2332
holyfuchs wants to merge 1 commit intomasteronflow/flow-cli:masterfrom
holyfuchs/improve-test-error-outputonflow/flow-cli:holyfuchs/improve-test-error-outputCopy head branch name to clipboard

Conversation

@holyfuchs
Copy link
Copy Markdown
Member

Closes #2331

Summary

When handleError passes a multi-line error message through lipgloss's Render, lipgloss normalizes every line to the width of the longest line, producing hundreds of trailing spaces that make the output completely unreadable.
This was most visible with flow test assertion failures containing a full Cadence transaction error chain serialized with literal \n sequences.

Fix

Added renderErrorMsg which:

  1. Unescapes literal \n sequences (common in serialized Cadence runtime errors)
  2. Styles each line individually via branding.ErrorStyle.Render(line) — passing a multiline block to lipgloss triggers the padding behavior, but single lines are safe

All errorMessageStyle.Render(...) calls in handleError now go through this function. The unused errorMessageStyle and descriptionStyle vars were also removed.

@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@holyfuchs holyfuchs marked this pull request as ready for review April 17, 2026 21:48
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/command/result.go 0.00% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

flow test prints unreadable output

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.