Skip to content

馃悰 fix: heading for argument groups without a title - #350

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:group-untitled
Aug 27, 2026
Merged

馃悰 fix: heading for argument groups without a title#350
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:group-untitled

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

parser.add_argument_group(description="only a description") has no title, and the directive rendered it as a heading reading tool with the anchor tool-None. A second untitled group produced a duplicate label warning on top, which fails any build running with -W. 馃悰

An untitled group now takes its description as the heading text, so tool only a description and tool another get distinct anchors and the description no longer repeats as a paragraph under the heading. A group with neither title nor description falls back to arguments, giving it the stable anchor tool-arguments. Titled groups render as before.

@gaborbernat gaborbernat added the bug Something isn't working label Aug 27, 2026
@gaborbernat
gaborbernat force-pushed the group-untitled branch 5 times, most recently from 1c34d85 to 7e90655 Compare August 27, 2026 16:16
An argument group created with only a description rendered its heading
as the program name followed by nothing, because the title was None,
and every such group shared the label tool-None; two of them raised a
duplicate label warning that fails builds run with -W.

The description now serves as the heading when the title is missing,
and a group with neither falls back to "arguments", so each section
keeps a distinct, stable anchor. Titled groups are untouched.
@gaborbernat
gaborbernat merged commit 7ac0457 into tox-dev:main Aug 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant