Skip to content

Commit acd6806

Browse files
author
Ricahrd Hammond
committed
Address formatting issues
1 parent 7071321 commit acd6806

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

cmd2/argparse_custom.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,7 @@ class ChoicesProviderFuncBase(Protocol):
352352
Function that returns a list of choices in support of tab completion
353353
"""
354354

355-
def __call__(self) -> List[str]:
356-
... # pragma: no cover
355+
def __call__(self) -> List[str]: ... # pragma: no cover
357356

358357

359358
@runtime_checkable
@@ -362,8 +361,7 @@ class ChoicesProviderFuncWithTokens(Protocol):
362361
Function that returns a list of choices in support of tab completion and accepts a dictionary of prior arguments.
363362
"""
364363

365-
def __call__(self, *, arg_tokens: Dict[str, List[str]] = {}) -> List[str]:
366-
... # pragma: no cover
364+
def __call__(self, *, arg_tokens: Dict[str, List[str]] = {}) -> List[str]: ... # pragma: no cover
367365

368366

369367
ChoicesProviderFunc = Union[ChoicesProviderFuncBase, ChoicesProviderFuncWithTokens]
@@ -381,8 +379,7 @@ def __call__(
381379
line: str,
382380
begidx: int,
383381
endidx: int,
384-
) -> List[str]:
385-
... # pragma: no cover
382+
) -> List[str]: ... # pragma: no cover
386383

387384

388385
@runtime_checkable
@@ -400,8 +397,7 @@ def __call__(
400397
endidx: int,
401398
*,
402399
arg_tokens: Dict[str, List[str]] = {},
403-
) -> List[str]:
404-
... # pragma: no cover
400+
) -> List[str]: ... # pragma: no cover
405401

406402

407403
CompleterFunc = Union[CompleterFuncBase, CompleterFuncWithTokens]

cmd2/decorators.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def _set_parser_prog(parser: argparse.ArgumentParser, prog: str) -> None:
247247
elif action.required:
248248
req_args.append(action.dest)
249249

250+
250251
#: Function signature for a Command Function that uses an argparse.ArgumentParser to process user input
251252
#: and optionally returns a boolean
252253
ArgparseCommandFuncOptionalBoolReturn = Callable[[CommandParent, argparse.Namespace], Optional[bool]]
@@ -272,8 +273,7 @@ def with_argparser(
272273
ns_provider: Optional[Callable[..., argparse.Namespace]] = None,
273274
preserve_quotes: bool = False,
274275
with_unknown_args: bool = False,
275-
) -> Callable[[ArgparseCommandFunc[CommandParent]], RawCommandFuncOptionalBoolReturn[CommandParent]]:
276-
... # pragma: no cover
276+
) -> Callable[[ArgparseCommandFunc[CommandParent]], RawCommandFuncOptionalBoolReturn[CommandParent]]: ... # pragma: no cover
277277

278278

279279
@overload
@@ -283,8 +283,7 @@ def with_argparser(
283283
ns_provider: Optional[Callable[..., argparse.Namespace]] = None,
284284
preserve_quotes: bool = False,
285285
with_unknown_args: bool = False,
286-
) -> Callable[[ArgparseCommandFunc[CommandParent]], RawCommandFuncOptionalBoolReturn[CommandParent]]:
287-
... # pragma: no cover
286+
) -> Callable[[ArgparseCommandFunc[CommandParent]], RawCommandFuncOptionalBoolReturn[CommandParent]]: ... # pragma: no cover
288287

289288

290289
def with_argparser(
@@ -424,8 +423,7 @@ def as_subcommand_to(
424423
*,
425424
help: Optional[str] = None,
426425
aliases: Optional[List[str]] = None,
427-
) -> Callable[[ArgparseCommandFunc[CommandParent]], ArgparseCommandFunc[CommandParent]]:
428-
... # pragma: no cover
426+
) -> Callable[[ArgparseCommandFunc[CommandParent]], ArgparseCommandFunc[CommandParent]]: ... # pragma: no cover
429427

430428

431429
@overload
@@ -436,8 +434,7 @@ def as_subcommand_to(
436434
*,
437435
help: Optional[str] = None,
438436
aliases: Optional[List[str]] = None,
439-
) -> Callable[[ArgparseCommandFunc[CommandParent]], ArgparseCommandFunc[CommandParent]]:
440-
... # pragma: no cover
437+
) -> Callable[[ArgparseCommandFunc[CommandParent]], ArgparseCommandFunc[CommandParent]]: ... # pragma: no cover
441438

442439

443440
def as_subcommand_to(

cmd2/history.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,10 @@ def _zero_based_index(self, onebased: Union[int, str]) -> int:
154154
return result
155155

156156
@overload
157-
def append(self, new: HistoryItem) -> None:
158-
... # pragma: no cover
157+
def append(self, new: HistoryItem) -> None: ... # pragma: no cover
159158

160159
@overload
161-
def append(self, new: Statement) -> None:
162-
... # pragma: no cover
160+
def append(self, new: Statement) -> None: ... # pragma: no cover
163161

164162
def append(self, new: Union[Statement, HistoryItem]) -> None:
165163
"""Append a new statement to the end of the History list.

0 commit comments

Comments
 (0)