Skip to content

Commit 7a00c25

Browse files
pyhedgehogAlexWaygoodAvasam
authored
Add stubs for click-default-group (#9304)
Co-authored-by: AlexWaygood <[email protected]> Co-authored-by: Avasam <[email protected]>
1 parent 81373c1 commit 7a00c25

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

pyrightconfig.stricter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"stubs/braintree",
3232
"stubs/caldav",
3333
"stubs/cffi",
34+
"stubs/click-default-group",
3435
"stubs/commonmark",
3536
"stubs/dateparser",
3637
"stubs/docutils",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version = "1.2.*"
2+
# requires a version of click with a py.typed
3+
requires = ["click>=8.0.0"]
4+
upstream_repository = "https://github.com/click-contrib/click-default-group"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import typing as t
2+
from _typeshed import Incomplete
3+
4+
import click
5+
6+
__version__: str
7+
8+
class DefaultGroup(click.Group):
9+
ignore_unknown_options: bool
10+
default_cmd_name: str | None
11+
default_if_no_args: bool
12+
def __init__(self, *args, **kwargs) -> None: ...
13+
def set_default_command(self, command: click.Command) -> None: ...
14+
def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]: ...
15+
def get_command(self, ctx: click.Context, cmd_name: str) -> click.Command | None: ...
16+
def resolve_command(self, ctx: click.Context, args: list[str]) -> tuple[str | None, click.Command | None, list[str]]: ...
17+
def format_commands(self, ctx: click.Context, formatter: click.HelpFormatter) -> None: ...
18+
def command(self, *args, **kwargs) -> click.Command: ... # incomplete
19+
20+
class DefaultCommandFormatter:
21+
group: click.Group
22+
formatter: click.HelpFormatter
23+
mark: str
24+
def __init__(self, group: click.Group, formatter: click.HelpFormatter, mark: str = ...) -> None: ...
25+
def write_dl(self, rows: t.Sequence[tuple[str, str]], col_max: int = 30, col_spacing: int = -2) -> None: ...
26+
def __getattr__(self, attr: str) -> Incomplete: ...
27+
# __getattr__ used to ala-derive from click.HelpFormatter:
28+
# indent_increment: int
29+
# width: int | None
30+
# current_indent: int
31+
# buffer: t.List[str]
32+
# def write(self, string: str) -> None: ...
33+
# def indent(self) -> None: ...
34+
# def dedent(self) -> None: ...
35+
# def write_usage(self, prog: str, args: str = ..., prefix: str | None = ...) -> None: ...
36+
# def write_heading(self, heading: str) -> None: ...
37+
# def write_paragraph(self) -> None: ...
38+
# def write_text(self, text: str) -> None: ...
39+
# def section(self, name: str) -> t.Iterator[None]: ...
40+
# def indentation(self) -> t.Iterator[None]: ...
41+
# def getvalue(self) -> str: ...

0 commit comments

Comments
 (0)