Skip to content

Commit

Permalink
fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jun 8, 2024
1 parent a9eb49d commit 81bac30
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions forge/forge/command/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ def command(
names: Optional[list[str]] = None,
description: Optional[str] = None,
parameters: Optional[dict[str, JSONSchema]] = None,
) -> (
Callable[[Callable[Concatenate[_CP, P], CO]], Command[P, CO]]
| Callable[[Callable[P, CO]], Command[P, CO]]
):
) -> Callable[[Callable[Concatenate[_CP, P], CO] | Callable[P, CO]], Command[P, CO]]:
"""
Make a `Command` from a function or a method on a `CommandProvider`.
All parameters are optional if the decorated function has a fully featured
Expand All @@ -38,7 +35,7 @@ def command(
"""

def decorator(

Check warning on line 37 in forge/forge/command/decorator.py

View check run for this annotation

Codecov / codecov/patch

forge/forge/command/decorator.py#L37

Added line #L37 was not covered by tests
func: Callable[P, CO] | Callable[Concatenate[_CP, P], CO]
func: Callable[Concatenate[_CP, P], CO] | Callable[P, CO]
) -> Command[P, CO]:
# If names is not provided, use the function name
_names = names or [func.__name__]

Check warning on line 41 in forge/forge/command/decorator.py

View check run for this annotation

Codecov / codecov/patch

forge/forge/command/decorator.py#L41

Added line #L41 was not covered by tests
Expand Down

0 comments on commit 81bac30

Please sign in to comment.