From f114c861b49cdf63cc771dc9577cad40bde3e58e Mon Sep 17 00:00:00 2001 From: didericis Date: Thu, 4 Jun 2026 12:40:36 -0400 Subject: [PATCH] fix: resolve pylint and pyright linting issues - Remove .keys() iteration in favor of direct dictionary iteration - Remove redundant os module reimport in tui.py - Disable unnecessary-ellipsis rule in pylintrc to avoid conflict with pyright's Protocol type requirements pyright: 0 errors pylint: 9.93/10 Co-Authored-By: Claude Haiku 4.5 --- .pylintrc | 3 ++- bot_bottle/cli/tui.py | 3 +-- bot_bottle/manifest_agent.py | 2 +- bot_bottle/manifest_git.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pylintrc b/.pylintrc index 3ecd7e9..f16bbc2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -419,7 +419,8 @@ disable=raw-checker-failed, too-many-instance-attributes, duplicate-code, import-outside-toplevel, - too-few-public-methods + too-few-public-methods, + unnecessary-ellipsis # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/bot_bottle/cli/tui.py b/bot_bottle/cli/tui.py index f28281b..a52260f 100644 --- a/bot_bottle/cli/tui.py +++ b/bot_bottle/cli/tui.py @@ -42,8 +42,7 @@ def filter_select( # Use os.dup() to duplicate the fd so the original file object # and FileIO in _run_picker each manage independent copies, # preventing double-close errors. - import os as _os - fd_dup = _os.dup(tty_fd.fileno()) + fd_dup = os.dup(tty_fd.fileno()) return _run_picker(items, title=title, tty_fd=fd_dup) finally: tty_fd.close() diff --git a/bot_bottle/manifest_agent.py b/bot_bottle/manifest_agent.py index b5d29ca..6ab63ef 100644 --- a/bot_bottle/manifest_agent.py +++ b/bot_bottle/manifest_agent.py @@ -161,7 +161,7 @@ class Agent: git_raw = d.get("git-gate") if git_raw is not None: gd = as_json_object(git_raw, f"agent '{name}' git-gate") - for k in gd.keys(): + for k in gd: if k != "user": raise ManifestError( f"agent '{name}' git-gate.{k} is not allowed at the " diff --git a/bot_bottle/manifest_git.py b/bot_bottle/manifest_git.py index 1fb5ced..81d845d 100644 --- a/bot_bottle/manifest_git.py +++ b/bot_bottle/manifest_git.py @@ -246,7 +246,7 @@ class GitUser: @classmethod def from_dict(cls, bottle_name: str, raw: object) -> "GitUser": d = as_json_object(raw, f"bottle '{bottle_name}' git-gate.user") - for k in d.keys(): + for k in d: if k not in {"name", "email"}: raise ManifestError( f"bottle '{bottle_name}' git-gate.user has unknown key {k!r}; " @@ -281,7 +281,7 @@ def parse_git_gate_config( raw: object, ) -> tuple[tuple[GitEntry, ...], GitUser]: d = as_json_object(raw, f"bottle '{bottle_name}' git-gate") - for k in d.keys(): + for k in d: if k not in {"user", "repos"}: raise ManifestError( f"bottle '{bottle_name}' git-gate has unknown key {k!r}; "