Skip to content

Commit 0aa1c5d

Browse files
committed
chore(ruff) Automated fixes for typing annotations
Fixed 9 errors: - src/tmuxp/cli/utils.py: 4 × UP006 (non-pep585-annotation) 1 × I001 (unsorted-imports) - src/tmuxp/shell.py: 1 × UP006 (non-pep585-annotation) - src/tmuxp/workspace/builder.py: 2 × UP006 (non-pep585-annotation) 1 × I001 (unsorted-imports) Found 1206 errors (9 fixed, 1197 remaining). 99 files left unchanged ruff check . --select ALL --fix --unsafe-fixes --preview --show-fixes --ignore T201 --ignore PT014 --ignore RUF100; ruff format .;
1 parent 82cfec3 commit 0aa1c5d

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/tmuxp/cli/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import re
55
import typing as t
6+
from collections.abc import Callable, Sequence
67

78
from tmuxp import log
89

@@ -35,7 +36,7 @@ def tmuxp_echo(
3536
def prompt(
3637
name: str,
3738
default: t.Optional[str] = None,
38-
value_proc: t.Optional[t.Callable[[str], str]] = None,
39+
value_proc: t.Optional[Callable[[str], str]] = None,
3940
) -> str:
4041
"""Return user input from command line.
4142
@@ -76,8 +77,8 @@ def prompt(
7677
def prompt_bool(
7778
name: str,
7879
default: bool = False,
79-
yes_choices: t.Optional[t.Sequence[t.Any]] = None,
80-
no_choices: t.Optional[t.Sequence[t.Any]] = None,
80+
yes_choices: t.Optional[Sequence[t.Any]] = None,
81+
no_choices: t.Optional[Sequence[t.Any]] = None,
8182
) -> bool:
8283
"""Return True / False by prompting user input from command line.
8384
@@ -128,7 +129,7 @@ def prompt_choices(
128129
name: str,
129130
choices: t.Union[list[str], tuple[str, str]],
130131
default: t.Optional[str] = None,
131-
no_choice: t.Sequence[str] = ("none",),
132+
no_choice: Sequence[str] = ("none",),
132133
) -> t.Optional[str]:
133134
"""Return user input from command line from set of provided choices.
134135

src/tmuxp/shell.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import pathlib
77
import typing as t
8+
from collections.abc import Callable
89

910
logger = logging.getLogger(__name__)
1011

@@ -115,7 +116,7 @@ def detect_best_shell() -> "CLIShellLiteral":
115116
def get_bpython(
116117
options: "LaunchOptionalImports",
117118
extra_args: t.Optional[dict[str, t.Any]] = None,
118-
) -> t.Callable[[], None]:
119+
) -> Callable[[], None]:
119120
"""Return bpython shell."""
120121
if extra_args is None:
121122
extra_args = {}

src/tmuxp/workspace/builder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import shutil
66
import time
77
import typing as t
8+
from collections.abc import Iterator
89

910
from libtmux._internal.query_list import ObjectDoesNotExist
1011
from libtmux.common import has_gte_version, has_lt_version
@@ -343,7 +344,7 @@ def iter_create_windows(
343344
self,
344345
session: Session,
345346
append: bool = False,
346-
) -> t.Iterator[t.Any]:
347+
) -> Iterator[t.Any]:
347348
"""Return :class:`libtmux.Window` iterating through session config dict.
348349
349350
Generator yielding :class:`libtmux.Window` by iterating through
@@ -444,7 +445,7 @@ def iter_create_panes(
444445
self,
445446
window: Window,
446447
window_config: dict[str, t.Any],
447-
) -> t.Iterator[t.Any]:
448+
) -> Iterator[t.Any]:
448449
"""Return :class:`libtmux.Pane` iterating through window config dict.
449450
450451
Run ``shell_command`` with ``$ tmux send-keys``.

0 commit comments

Comments
 (0)