fix: reflow multi-line command description prose in help output#50
Merged
Conversation
Pass the description verbatim to `Markdown` in `RichFormatter._print_description()` instead of joining lines with a hard break (`" \n"`). Wrapped docstring lines now reflow to terminal width, while blank lines are preserved as paragraph breaks.
Contributor
There was a problem hiding this comment.
Import Performance
Details
| Benchmark suite | Current: 93478f5 | Previous: b17dcd9 | Ratio |
|---|---|---|---|
piou (core) |
84.25 ms (0.52) |
92.72 ms (1.76) |
0.91 |
piou (rich) |
139.44 ms (4.83) |
148.08 ms (3.65) |
0.94 |
piou.tui |
274.16 ms (3.89) |
298.9 ms (12.13) |
0.92 |
This comment was automatically generated by workflow using github-action-benchmark.
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.
What
RichFormatter._print_description()joined every description line with a Markdown hard break (" \n"), so a wrapped docstring reproduced its source line breaks verbatim in-houtput — leaving orphan fragments likeand TLS certandmulti-projecton their own lines.This passes the description verbatim to
Markdowninstead.Effect
Prose within a paragraph now reflows to terminal width; blank lines remain paragraph breaks.
Before
After
Trade-off
A single
\nin a description no longer forces a line break — use a blank line, two trailing spaces, or a Markdown list/code block for intentional breaks (standard Markdown semantics).All 66 formatter tests pass.