Skip to content

Commit 9ebef00

Browse files
committed
Drop type:ignore codes made unused by newer argcomplete
The lint job's mypy hook installs an unpinned argcomplete (>=3.1); recent releases (3.7+) ship type information, so the `no-untyped-call` codes on the argcomplete.split_line / argcomplete.debug calls and on ExtendedCompletionFinder() are now unused, which mypy reports as errors under warn_unused_ignores. Remove just those codes, keeping the still-needed `attr-defined` codes and the `no-untyped-call` ignores on the super() _get_completions/_get_option_completions calls, which remain untyped. Verified with argcomplete 3.7.1 (as resolved in CI) and mypy 2.3.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VaKDJ3fpGf7anQeYeBsJbk
1 parent c476234 commit 9ebef00

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

traitlets/config/argcomplete_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_argcomplete_cwords() -> list[str] | None:
4545
_cword_suffix,
4646
comp_words,
4747
_last_wordbreak_pos,
48-
) = argcomplete.split_line(comp_line, comp_point) # type:ignore[attr-defined,no-untyped-call]
48+
) = argcomplete.split_line(comp_line, comp_point) # type:ignore[attr-defined]
4949
except ModuleNotFoundError:
5050
return None
5151

@@ -73,7 +73,7 @@ def increment_argcomplete_index() -> None:
7373
os.environ["_ARGCOMPLETE"] = str(int(os.environ["_ARGCOMPLETE"]) + 1)
7474
except Exception:
7575
try:
76-
argcomplete.debug("Unable to increment $_ARGCOMPLETE", os.environ["_ARGCOMPLETE"]) # type:ignore[attr-defined,no-untyped-call]
76+
argcomplete.debug("Unable to increment $_ARGCOMPLETE", os.environ["_ARGCOMPLETE"]) # type:ignore[attr-defined]
7777
except (KeyError, ModuleNotFoundError):
7878
pass
7979

@@ -194,7 +194,7 @@ def _get_completions(self, comp_words: list[str], cword_prefix: str, *args: t.An
194194
# Instead, check if comp_words only consists of the script,
195195
# if so check if any subcommands start with cword_prefix.
196196
if self.subcommands and len(comp_words) == 1:
197-
argcomplete.debug("Adding subcommands for", cword_prefix) # type:ignore[attr-defined,no-untyped-call]
197+
argcomplete.debug("Adding subcommands for", cword_prefix) # type:ignore[attr-defined]
198198
completions.extend(subc for subc in self.subcommands if subc.startswith(cword_prefix))
199199

200200
return completions

traitlets/config/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def _argcomplete(self, classes: list[t.Any], subcommands: SubcommandsDict | None
11331133

11341134
from . import argcomplete_config
11351135

1136-
finder = argcomplete_config.ExtendedCompletionFinder() # type:ignore[no-untyped-call]
1136+
finder = argcomplete_config.ExtendedCompletionFinder()
11371137
finder.config_classes = classes
11381138
finder.subcommands = list(subcommands or [])
11391139
# for ease of testing, pass through self._argcomplete_kwargs if set

0 commit comments

Comments
 (0)