Skip to content

Commit 108df99

Browse files
committed
Fix type hint and docstring of parse_comment
This function never returns `None`, so the type hint has been edited to reflect this. The docstring has also been updated to describe the correct return value.
1 parent c971206 commit 108df99

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packit_service/worker/jobs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class ParsedComment:
104104
def parse_comment(
105105
comment: str,
106106
packit_comment_command_prefix: str,
107-
) -> Optional[ParsedComment]:
107+
) -> ParsedComment:
108108
"""
109109
Get arguments from the given comment respecting `packit_comment_command_prefix`.
110110
@@ -113,8 +113,7 @@ def parse_comment(
113113
packit_comment_command_prefix: `/packit` for packit-prod or `/packit-stg` for stg
114114
115115
Returns:
116-
ParsedComment storing command inside comment and monorepo package if specified
117-
If comment isn't recognized, ParsedComment containing empty strings is returned instead
116+
ParsedComment storing command and monorepo package if specified
118117
119118
For example: If the comment is `/packit build --commit 123 --package best-package-ever`,
120119
it would return ParsedComment(command="build", package="best-package-ever")

0 commit comments

Comments
 (0)