Ignore private access specifically; don't mask future removals/renames

Found these with regexp: /\._.+ type: ignore/
I also looked for: /import (\w+,\s*)*_/
And: /^from (\w+\.)*_/
This commit is contained in:
Isaiah Odhner 2023-09-16 23:03:04 -04:00
parent 06344fb8de
commit 99a5441a10
2 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ def restart_program() -> None:
# It's meant to eventually call this, but we need it immediately (unless we delay with asyncio perhaps)
# Otherwise the terminal will be left in a state where you can't (visibly) type anything
# if you exit the app after reloading, since the new process will pick up the old terminal state.
_app._driver.stop_application_mode() # type: ignore
_app._driver.stop_application_mode() # pyright: ignore[reportPrivateUsage, reportOptionalMemberAccess]
except Exception as e:
print("Error stopping application mode. The command line may not work as expected. The `reset` command should restore it on Linux.", e)

View File

@ -75,7 +75,7 @@ class EnhancedDirectoryTree(DirectoryTree):
# So instead, listen for NodeHighlighted,
# and then clear the flag.
region = self._get_label_region(node._line) # type: ignore
region = self._get_label_region(node._line) # pyright: ignore[reportPrivateUsage]
assert region, "Node not found in tree"
self.scroll_to_region(region, animate=False, top=True)
@ -188,7 +188,7 @@ class EnhancedDirectoryTree(DirectoryTree):
Returns:
A Rich Text object containing the label.
"""
node_label = node._label.copy() # type: ignore
node_label = node._label.copy() # pyright: ignore[reportPrivateUsage]
if PYTEST and node_label.plain == "\\":
# Normalize root node display for cross-platform snapshot testing.
@ -197,7 +197,7 @@ class EnhancedDirectoryTree(DirectoryTree):
node_label.stylize(style)
if node._allow_expand: # type: ignore
if node._allow_expand: # pyright: ignore[reportPrivateUsage]
prefix = (FOLDER_OPEN_ICON if node.is_expanded else FOLDER_CLOSED_ICON).copy()
prefix.stylize_before(base_style + TOGGLE_STYLE)
node_label.stylize_before(