From 024d34ec8af6485315d277e21b1c0190ebb85c0e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Sep 2026 09:35:54 +0530 Subject: [PATCH] Make ty 79 happy --- kittens/tui/path_completer.py | 2 +- kitty/boss.py | 4 ++-- kitty/conf/utils.py | 2 +- kitty/main.py | 2 +- kitty/rc/base.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kittens/tui/path_completer.py b/kittens/tui/path_completer.py index 0ea6c4a41..aeb272ba2 100644 --- a/kittens/tui/path_completer.py +++ b/kittens/tui/path_completer.py @@ -84,7 +84,7 @@ class PathCompleter: from .dircolors import Dircolors - if 'libedit' in getattr(readline, '__doc__', '') or '': + if 'libedit' in getattr(readline, '__doc__', '') or '': # ty: ignore[redundant-condition] readline.parse_and_bind('bind -e') readline.parse_and_bind("bind '\t' rl_complete") else: diff --git a/kitty/boss.py b/kitty/boss.py index 78cd75a02..99a2be457 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -472,7 +472,7 @@ class Boss: with Window.set_ignore_focus_changes_for_new_windows(): for startup_session in si: # The window state from the CLI options will override and apply to every single OS window in startup session - wstate = self.args.start_as if self.args.start_as and self.args.start_as != 'normal' else None + wstate = self.args.start_as if self.args.start_as and self.args.start_as != 'normal' else None # ty: ignore[redundant-condition] wid = self.add_os_window(startup_session, window_state=wstate, os_window_id=os_window_id) if startup_session.focus_os_window: focused_os_window = wid @@ -1065,7 +1065,7 @@ class Boss: assert isinstance(window.launch_spec, LaunchSpec) launch(get_boss(), window.launch_spec.opts, window.launch_spec.args) continue - wstate = args.start_as if args.start_as and args.start_as != 'normal' else None + wstate = args.start_as if args.start_as and args.start_as != 'normal' else None # ty: ignore[redundant-condition] os_window_id = self.add_os_window( session, wclass=args.cls, diff --git a/kitty/conf/utils.py b/kitty/conf/utils.py index ca7874de5..aed140def 100644 --- a/kitty/conf/utils.py +++ b/kitty/conf/utils.py @@ -557,7 +557,7 @@ def parse_kittens_key(val: str, funcs_with_args: dict[str, KeyFunc[tuple[str, An def uniq(vals: Iterable[T]) -> list[T]: seen: set[T] = set() seen_add = seen.add - return [x for x in vals if x not in seen and not seen_add(x)] + return [x for x in vals if x not in seen and not seen_add(x)] # ty: ignore[redundant-condition] def save_type_stub(text: str, fpath: str) -> None: diff --git a/kitty/main.py b/kitty/main.py index 97f91386b..bb7944469 100644 --- a/kitty/main.py +++ b/kitty/main.py @@ -317,7 +317,7 @@ def _run_app(opts: Options, args: CLIOptions, bad_lines: Sequence[BadLine] = (), startup_sessions = tuple(create_sessions(opts, args)) wincls = (startup_sessions[0].os_window_class if startup_sessions else '') or args.cls or appname winname = (startup_sessions[0].os_window_name if startup_sessions else '') or args.name or wincls or appname - window_state = (args.start_as if args.start_as and args.start_as != 'normal' else None) or ( + window_state = (args.start_as if args.start_as and args.start_as != 'normal' else None) or ( # ty: ignore[redundant-condition] getattr(startup_sessions[0], 'os_window_state', None) if startup_sessions else None ) # Remember the maximized state from the previous session, if enabled. diff --git a/kitty/rc/base.py b/kitty/rc/base.py index d30407817..719c4217c 100644 --- a/kitty/rc/base.py +++ b/kitty/rc/base.py @@ -218,7 +218,7 @@ class ArgsHandling: c = self.args_count if c is not None: yield f'{go_name}.StopCompletingAtArg = {c}' - if self.completion: + if self.completion: # ty: ignore[redundant-condition] yield from self.completion.as_go_code(go_name + '.ArgCompleter', ' = ') def as_go_code(self, cmd_name: str, field_types: dict[str, str], handled_fields: set[str]) -> Iterator[str]: