mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 05:28:13 +02:00
made a better job to check if the second comment
is an answer to the first one
This commit is contained in:
@ -52,9 +52,12 @@ def is_pull_good(pull: PullRequest, verbose: bool = False) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if comments.totalCount == 2:
|
if comments.totalCount == 2:
|
||||||
comment_list = list(comments)
|
comment_1, comment_2 = sorted(comments, key=lambda c: c.created_at)
|
||||||
second_comment = comment_list[1]
|
|
||||||
if second_comment.user.login != pull.user.login:
|
is_reply = comment_2.in_reply_to_id == comment_1.id
|
||||||
|
is_from_author = comment_2.user.id == pull.user.id
|
||||||
|
|
||||||
|
if not (is_reply and is_from_author):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return has_only_1_comment(pull.get_commits(), pull.get_review_comments(), verbose=verbose)
|
return has_only_1_comment(pull.get_commits(), pull.get_review_comments(), verbose=verbose)
|
||||||
|
Reference in New Issue
Block a user