Skip to content

Commit

Permalink
chore(ruff) Automated fixes for typing annotations
Browse files Browse the repository at this point in the history
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 .;
  • Loading branch information
tony committed Jan 4, 2025
1 parent 82cfec3 commit 0aa1c5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/tmuxp/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import re
import typing as t
from collections.abc import Callable, Sequence

from tmuxp import log

Expand Down Expand Up @@ -35,7 +36,7 @@ def tmuxp_echo(
def prompt(
name: str,
default: t.Optional[str] = None,
value_proc: t.Optional[t.Callable[[str], str]] = None,
value_proc: t.Optional[Callable[[str], str]] = None,
) -> str:
"""Return user input from command line.
Expand Down Expand Up @@ -76,8 +77,8 @@ def prompt(
def prompt_bool(
name: str,
default: bool = False,
yes_choices: t.Optional[t.Sequence[t.Any]] = None,
no_choices: t.Optional[t.Sequence[t.Any]] = None,
yes_choices: t.Optional[Sequence[t.Any]] = None,
no_choices: t.Optional[Sequence[t.Any]] = None,
) -> bool:
"""Return True / False by prompting user input from command line.
Expand Down Expand Up @@ -128,7 +129,7 @@ def prompt_choices(
name: str,
choices: t.Union[list[str], tuple[str, str]],
default: t.Optional[str] = None,
no_choice: t.Sequence[str] = ("none",),
no_choice: Sequence[str] = ("none",),
) -> t.Optional[str]:
"""Return user input from command line from set of provided choices.
Expand Down
3 changes: 2 additions & 1 deletion src/tmuxp/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import pathlib
import typing as t
from collections.abc import Callable

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -115,7 +116,7 @@ def detect_best_shell() -> "CLIShellLiteral":
def get_bpython(
options: "LaunchOptionalImports",
extra_args: t.Optional[dict[str, t.Any]] = None,
) -> t.Callable[[], None]:
) -> Callable[[], None]:
"""Return bpython shell."""
if extra_args is None:
extra_args = {}
Expand Down
5 changes: 3 additions & 2 deletions src/tmuxp/workspace/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil
import time
import typing as t
from collections.abc import Iterator

from libtmux._internal.query_list import ObjectDoesNotExist
from libtmux.common import has_gte_version, has_lt_version
Expand Down Expand Up @@ -343,7 +344,7 @@ def iter_create_windows(
self,
session: Session,
append: bool = False,
) -> t.Iterator[t.Any]:
) -> Iterator[t.Any]:
"""Return :class:`libtmux.Window` iterating through session config dict.
Generator yielding :class:`libtmux.Window` by iterating through
Expand Down Expand Up @@ -444,7 +445,7 @@ def iter_create_panes(
self,
window: Window,
window_config: dict[str, t.Any],
) -> t.Iterator[t.Any]:
) -> Iterator[t.Any]:
"""Return :class:`libtmux.Pane` iterating through window config dict.
Run ``shell_command`` with ``$ tmux send-keys``.
Expand Down

0 comments on commit 0aa1c5d

Please sign in to comment.