Skip to content

Commit f6e2e46

Browse files
authored
Merge pull request #72 from adamtheturtle/pyright
Fix some errors I hit while using this library with pyright
2 parents 89c3508 + 913d7df commit f6e2e46

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/click_option_group/_decorators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def group(
9696
*,
9797
help: Optional[str] = None,
9898
cls: Optional[Type[OptionGroup]] = None,
99-
**attrs,
100-
) -> Decorator:
99+
**attrs: Any,
100+
) -> Decorator[F]:
101101
"""The decorator creates a new group and collects its options
102102
103103
Creates the option group and registers all grouped options
@@ -115,7 +115,7 @@ def group(
115115
msg = "'cls' must be a subclass of 'OptionGroup' class."
116116
raise TypeError(msg)
117117

118-
def decorator(func):
118+
def decorator(func: F) -> F:
119119
callback, params = get_callback_and_params(func)
120120

121121
if callback not in self._decorating_state:
@@ -153,7 +153,7 @@ def decorator(func):
153153

154154
return decorator
155155

156-
def option(self, *param_decls, **attrs) -> Decorator:
156+
def option(self, *param_decls: str, **attrs: Any) -> Decorator[F]:
157157
"""The decorator adds a new option to the group
158158
159159
The decorator is lazy. It adds option decls and attrs.
@@ -163,7 +163,7 @@ def option(self, *param_decls, **attrs) -> Decorator:
163163
:param attrs: additional option attributes and parameters
164164
"""
165165

166-
def decorator(func):
166+
def decorator(func: F) -> F:
167167
callback, params = get_callback_and_params(func)
168168

169169
option_stack = self._decorating_state[callback]
@@ -177,7 +177,7 @@ def decorator(func):
177177

178178
return decorator
179179

180-
def help_option(self, *param_decls, **attrs) -> Decorator:
180+
def help_option(self, *param_decls: str, **attrs: Any) -> Decorator[F]:
181181
"""This decorator adds a help option to the group, which prints
182182
the command's help text and exits.
183183
"""

0 commit comments

Comments
 (0)