Skip to content

Deduplicate deprecated label translation#3430

Merged
Rowlando13 merged 2 commits into
pallets:mainfrom
kdeldycke:deduplicate-deprecated-message
May 16, 2026
Merged

Deduplicate deprecated label translation#3430
Rowlando13 merged 2 commits into
pallets:mainfrom
kdeldycke:deduplicate-deprecated-message

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented May 15, 2026

A small bugfix PR at #3423 hinted at inconsistencies in the way deprecated messages were produced and translated.

We discussed these message translation on PR #2902 , which reminded me of duplicate messages.

Turns out we can deduplicate these messages with some simple helper.

CC @sjoubert @ic @v--

@kdeldycke kdeldycke added the f:help feature: help text label May 15, 2026
@kdeldycke kdeldycke added this to the 8.4.0 milestone May 15, 2026
@kdeldycke kdeldycke requested review from Rowlando13 and davidism May 15, 2026 11:17
@kdeldycke kdeldycke force-pushed the deduplicate-deprecated-message branch from 43f5e77 to c040135 Compare May 15, 2026 11:17
@Rowlando13 Rowlando13 merged commit 3619563 into pallets:main May 16, 2026
11 of 12 checks passed
@kdeldycke kdeldycke deleted the deduplicate-deprecated-message branch May 16, 2026 04:53
Copy link
Copy Markdown
Contributor

@ic ic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for sharing. Nice for consistent formatting. One question, perhaps leading to simpler type signature.

Comment thread src/click/core.py
raise RuntimeError(message)


def _format_deprecated_label(deprecated: bool | str) -> str:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, why the bool argument type option in the two new helpers? Not used in the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f:help feature: help text

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants