Repository navigation
Preserve Click no-wrap paragraphs in docstrings - #395
Merged
weibullguy merged 1 commit intoOct 16, 2026
Merged
Conversation
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.
Click uses a standalone
\bline to preserve a paragraph in command help. Formatting currently joins that marker with the next line, so Click rewraps the paragraph and can split manually arranged text or URLs.Preserve paragraphs beginning with that marker, including a marker at the start of the docstring, while continuing to wrap surrounding prose. Keep explicit
--force-wrapbehavior. Cover literal and actual backspace markers, indentation, long URLs, adjacent paragraphs, negative cases and formatter idempotence.Fixes #291.
Validation on macOS:
CliRunnerhelp output is unchanged in four before/after scenarios, covering the original example and a first-paragraph marker, each with and without a long URL.Commands:
VIRTUAL_ENV=<venv> PATH=<venv>/bin:$PATH python -m pytest -q; targeted tests intests/wrappers/test_description_wrapper.pyandtests/formatter/test_do_format_code.py;python -m ruff check,python -m black --check,python -m isort --check-only,python -m mypy,python -m pydocstyleon the affected files. The two full Python suites were run serially because existing fixtures share a fixed temporary configuration path; an initial concurrent run interfered with that fixture, and the serial rerun passed.Linux, Windows, PyPy and Python 3.11–3.13 were not executed locally. AI-assisted implementation and review; the runtime behavior and checks above were executed against this commit.