Skip to content

Commit dda95bb

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
commands: document protocol methods
Add docststrings to various protocol types. Some are a bit vague as these are protocols not concrete types. Signed-off-by: John Mulligan <[email protected]>
1 parent 3a39e1e commit dda95bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sambacc/commands/cli.py

+8
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ class Fail(ValueError):
4141

4242

4343
class Parser(typing.Protocol):
44+
"""Minimal protocol for wrapping argument parser or similar."""
45+
4446
def set_defaults(self, **kwargs: typing.Any) -> None:
47+
"""Set a default value for an argument parser."""
4548
... # pragma: no cover
4649

4750
def add_argument(
4851
self, *args: typing.Any, **kwargs: typing.Any
4952
) -> typing.Any:
53+
"""Add an argument to be parsed."""
5054
... # pragma: no cover
5155

5256

@@ -133,18 +137,22 @@ class Context(typing.Protocol):
133137

134138
@property
135139
def cli(self) -> argparse.Namespace:
140+
"""Return a parsed command line namespace object."""
136141
... # pragma: no cover
137142

138143
@property
139144
def instance_config(self) -> config.InstanceConfig:
145+
"""Return an instance config based on cli params and env."""
140146
... # pragma: no cover
141147

142148
@property
143149
def require_validation(self) -> typing.Optional[bool]:
150+
"""Return true if configuration needs validation."""
144151
... # pragma: no cover
145152

146153
@property
147154
def opener(self) -> opener.Opener:
155+
"""Return an appropriate opener object for this instance."""
148156
... # pragma: no cover
149157

150158

0 commit comments

Comments
 (0)