Skip to content

AI junk - #3797

Closed
mishra-naman wants to merge 1 commit into
pallets:mainfrom
mishra-naman:fix-usage-hyphen-break-3362
Closed

AI junk#3797
mishra-naman wants to merge 1 commit into
pallets:mainfrom
mishra-naman:fix-usage-hyphen-break-3362

Conversation

@mishra-naman

Copy link
Copy Markdown

The usage line wrapped arguments with textwrap's default break_on_hyphens=True, so long options like --max-retry-count were split across lines at a hyphen (e.g. --max- / retry-count).

This threads a break_on_hyphens parameter through wrap_text() (default True, so all existing behaviour is unchanged) and passes False from HelpFormatter.write_usage(), keeping option tokens intact.

Before

Usage: program --enable-verbose-logging --output-file-path --max-
retry-count --disable-cache-mode --config-file-
location ...

After

Usage: program --enable-verbose-logging --output-file-path
--max-retry-count --disable-cache-mode
--config-file-location ...

Notes

  • Added a regression test in tests/test_formatting.py (fails without the change, passes with it).
  • Updated the wrap_text docstring + .. versionchanged::, and added a CHANGES.md entry linking the issue.
  • Full test suite: 1914 passed, 0 failures; ruff check / ruff format clean.

fixes#3362

`HelpFormatter.write_usage` wrapped arguments with `textwrap`'s default
`break_on_hyphens=True`, so long options like `--max-retry-count` could
be split across lines at a hyphen. Thread a `break_on_hyphens` parameter
through `wrap_text` (default `True`, preserving existing behaviour) and
pass `False` from `write_usage` so option tokens stay intact.
fixespallets#3362
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@davidism

Copy link
Copy Markdown
Member

@davidismdavidism added the rejected AI Contribution rejected because of its untrustworthy AI origin label Aug 27, 2026
@davidismdavidism changed the title Don't break usage-line options at hyphensAI junkAug 27, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rejected AIContribution rejected because of its untrustworthy AI origin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HelpFormatter.write_usage breaks options at a hyphen

2 participants

@mishra-naman@davidism