Skip to content

馃悰 Ensure that hidden commands are not shown when Rich markup is disabled - #1812

Merged
tiangolo merged 7 commits into
fastapi:masterfrom
svlandeg:fix/hidden
Jun 1, 2026
Merged

馃悰 Ensure that hidden commands are not shown when Rich markup is disabled#1812
tiangolo merged 7 commits into
fastapi:masterfrom
svlandeg:fix/hidden

Conversation

@svlandeg

@svlandeg svlandeg commented Jun 1, 2026

Copy link
Copy Markdown
Member

Discussion: #1795, reported by @igor47.

Description

Hidden commands were shown when Rich formatting was turned off. This is a regression from Typer 0.26.0 which vendored Click, more specifically the bug was introduced by PR 1680. There were no relevant unit tests for this specific functionality, as most tests have Rich enabled.

I took the liberty to update an existing unit test "test_corner_cases" and gave it a more descriptive name "test_hidden" to test both a hidden option (existing test) as well as hidden commands (new tests).

AI Disclaimer

Used Cursor to help me debug the issue and write the first draft of the unit test. Reviewed and rewritten the test manually.

Checklist

  • I added tests for the change.
  • The new or updated tests fail on the main branch and pass on this PR.
  • Coverage stays at 100%.

@svlandeg svlandeg changed the title Fix/hidden 馃悰 Ensure that hidden commands are not shown when Rich markup is None Jun 1, 2026
@svlandeg svlandeg added the bug Something isn't working label Jun 1, 2026
@svlandeg
svlandeg marked this pull request as ready for review June 1, 2026 14:23
@svlandeg svlandeg changed the title 馃悰 Ensure that hidden commands are not shown when Rich markup is None 馃悰 Ensure that hidden commands are not shown when Rich markup is disabled Jun 1, 2026

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent, thank you! 馃檶

This will be avaiable in the next few hours in Typer 0.26.5 馃殌

@tiangolo
tiangolo merged commit 9172486 into fastapi:master Jun 1, 2026
22 checks passed
@svlandeg
svlandeg deleted the fix/hidden branch June 1, 2026 14:36
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.

2 participants