Skip to content

Enable unreachable code checks in tui/ with mypy#3518

Merged
svartkanin merged 1 commit intoarchlinux:masterfrom
correctmost:cm/enable-unreachable-checks-tui
May 28, 2025
Merged

Enable unreachable code checks in tui/ with mypy#3518
svartkanin merged 1 commit intoarchlinux:masterfrom
correctmost:cm/enable-unreachable-checks-tui

Conversation

@correctmost
Copy link
Copy Markdown
Contributor

PR Description:

Enabling unreachable code checks can help find dead code and incorrect type annotations.

Tests and Checks

  • I have tested the code!

@correctmost correctmost requested a review from Torxed as a code owner May 28, 2025 02:11

assert self._menu_vp is not None
self._items_state: MenuItemsState = MenuItemsState(
self._items_state: MenuItemsState = MenuItemsState( # type: ignore[unreachable]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a false positive from mypy:
python/mypy#11969

self._show_help()
return None
case MenuKeys.ESC:
if self._help_active:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This check is already performed on line 619

@svartkanin svartkanin merged commit 5c8721a into archlinux:master May 28, 2025
9 checks passed
@correctmost correctmost deleted the cm/enable-unreachable-checks-tui branch May 28, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants