Skip to content

Commit 0c89f1a

Browse files
committed
Update docstrings.
1 parent d48de6e commit 0c89f1a

7 files changed

Lines changed: 22 additions & 11 deletions

File tree

consolekit/commands.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ class ContextInheritingGroup(click.Group):
336336
.. autosummary-widths:: 5/16
337337
"""
338338

339-
def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], click.Command]: # type: ignore[override]
339+
def command( # type: ignore[override] # noqa: PRM002
340+
self,
341+
*args,
342+
**kwargs,
343+
) -> Callable[[Callable[..., Any]], click.Command]:
340344
"""
341345
A shortcut decorator for declaring and attaching a command to the group.
342346
@@ -348,7 +352,11 @@ def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], click.Comma
348352
kwargs.setdefault("context_settings", self.context_settings)
349353
return super().command(*args, **kwargs)
350354

351-
def group(self, *args, **kwargs) -> Callable[[Callable[..., Any]], click.Group]: # type: ignore[override]
355+
def group( # type: ignore[override] # noqa: PRM002
356+
self,
357+
*args,
358+
**kwargs,
359+
) -> Callable[[Callable[..., Any]], click.Group]:
352360
"""
353361
A shortcut decorator for declaring and attaching a group to the group.
354362

consolekit/input.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def stderr_input(prompt: str = '', file: IO = sys.stdout) -> str: # pragma: no
233233
234234
On Unix, GNU readline is used if enabled.
235235
236-
The ``prompt`` string, if given, is printed to stderr without a trailing newline before reading.
236+
:param prompt: If given, is printed to stderr without a trailing newline before reading.
237+
:param file:
237238
"""
238239

239240
if file is sys.stdout:

consolekit/options.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def flag_option(*args, default: Optional[bool] = False, **kwargs) -> Callable[[_
231231
)
232232

233233

234-
def auto_default_option(*param_decls, **attrs) -> Callable[[_C], _C]:
234+
def auto_default_option(*param_decls, **attrs) -> Callable[[_C], _C]: # noqa: PRM002
235235
"""
236236
Attaches an option to the command, with a default value determined from the decorated function's signature.
237237
@@ -279,7 +279,7 @@ def _get_default_from_callback_and_set(command: click.Command, param: click.Para
279279
param.required = False
280280

281281

282-
def auto_default_argument(*param_decls, **attrs) -> Callable[[_C], _C]:
282+
def auto_default_argument(*param_decls, **attrs) -> Callable[[_C], _C]: # noqa: PRM002
283283
"""
284284
Attaches an argument to the command, with a default value determined from the decorated function's signature.
285285
@@ -459,7 +459,7 @@ def get_default(self, ctx): # noqa: MAN001,MAN002,D102
459459

460460
class _Option(click.Option):
461461

462-
def prompt_for_value(self, ctx: click.Context): # noqa: MAN002
462+
def prompt_for_value(self, ctx: click.Context): # noqa: MAN002,PRM002
463463
"""
464464
This is an alternative flow that can be activated in the full value processing if a value does not exist.
465465
@@ -489,7 +489,7 @@ def prompt_for_value(self, ctx: click.Context): # noqa: MAN002
489489
)
490490

491491

492-
class DescribedArgument(click.Argument):
492+
class DescribedArgument(click.Argument): # noqa: PRM002
493493
r"""
494494
:class:`click.Argument` with an additional keyword argument and attribute giving a short description.
495495

consolekit/terminal_colours.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ def __exit__(self, exc_type, exc_val, exc_tb) -> None:
243243
def __call__(self, text) -> str: # noqa: MAN001
244244
"""
245245
Returns the given text in this colour.
246+
247+
:param text: Any object that can be converted to string (but typically a :class:`str` or perhaps :class:`int` or :class:`float`).
246248
"""
247249

248250
return f"{self}{text}{self.reset}"
@@ -447,7 +449,7 @@ class AnsiCodes(ABC):
447449
_stack: Union[Deque[str], List[str]]
448450
_reset: str
449451

450-
def __init_subclass__(cls, **kwargs) -> None:
452+
def __init_subclass__(cls, **kwargs) -> None: # noqa: PRM002
451453
"""
452454
The subclasses declare class attributes which are numbers.
453455

consolekit/testing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ class Result(click.testing.Result):
9999
:param exit_code: The command's exit code.
100100
:param exception: The exception that occurred, if any.
101101
:param exc_info: The traceback, if an exception occurred.
102+
:param output_bytes:
102103
"""
103104

104105
runner: click.testing.CliRunner

consolekit/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def overtype(
164164
165165
.. TODO:: This does not currently work in the PyCharm console, at least on Windows
166166
167-
:param objects: A list of strings or string-like objects to write to the terminal.
167+
:param \*objects: A list of strings or string-like objects to write to the terminal.
168168
:param sep: String to separate the objects with.
169169
:param end: String to end with.
170170
:param file: An object with a ``write(string)`` method.

consolekit/versions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,13 @@ def get_version_callback(
8787
With each ``--version`` argument the callback displays the package version,
8888
then adds the python version, and finally adds dependency versions.
8989
90-
9190
:param tool_version: The version of the tool to show the version of.
9291
:param tool_name: The name of the tool to show the version of.
9392
:param dependencies: Either a list of dependency names,
9493
or a mapping of dependency name to a more human-readable form.
9594
"""
9695

97-
def version_callback(ctx: click.Context, param: click.Option, value: int) -> None:
96+
def version_callback(ctx: click.Context, param: click.Option, value: int) -> None: # noqa: PRM002
9897
"""
9998
Callback for displaying the package version (and optionally the Python runtime).
10099
"""

0 commit comments

Comments
 (0)