Skip to content
Myr

Add type annotations for instance attributes in `shell_completion` (#3455)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rowlando13 · committed by GitHub · parents 29bacc7, ea76281 · Browse files · 1 file+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−6 removed

  • other:+11 added−6 removed

1 file+11 added−6 removed

modified:src/click/shell_completion.py+11 added-6 removed
220 unmodified lines
221 """Completion script template formatted by :meth:`source`. This must222 be provided by subclasses.223 """224225 cli: Command226 ctx_args: cabc.MutableMapping[str, t.Any]227 prog_name: str228 complete_var: str229230 def __init__(231 self,232 cli: Command,233 ctx_args: cabc.MutableMapping[str, t.Any],
75 unmodified lines
309310class BashComplete(ShellComplete):311 """Shell completion for Bash."""312308 name = "bash"309 source_template = _SOURCE_BASH313 name: t.ClassVar[str] = "bash"314 source_template: t.ClassVar[str] = _SOURCE_BASH315316 @staticmethod317 def _check_version() -> None:318 import shutil
49 unmodified lines
368369class ZshComplete(ShellComplete):370 """Shell completion for Zsh."""371367 name = "zsh"368 source_template = _SOURCE_ZSH372 name: t.ClassVar[str] = "zsh"373 source_template: t.ClassVar[str] = _SOURCE_ZSH374375 def get_completion_args(self) -> tuple[list[str], str]:376 cwords = split_arg_string(os.environ["COMP_WORDS"])377 cword = int(os.environ["COMP_CWORD"])
26 unmodified lines
404405class FishComplete(ShellComplete):406 """Shell completion for Fish."""407403 name = "fish"404 source_template = _SOURCE_FISH408 name: t.ClassVar[str] = "fish"409 source_template: t.ClassVar[str] = _SOURCE_FISH410411 def get_completion_args(self) -> tuple[list[str], str]:412 cwords = split_arg_string(os.environ["COMP_WORDS"])413 incomplete = os.environ["COMP_CWORD"]
268 unmodified lines