From b9501f9aaca508c82202b7aa71e810c54d3a8e56 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Wed, 5 Mar 2025 09:55:19 +0100 Subject: [PATCH] compacted code --- pull_requests.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pull_requests.py b/pull_requests.py index 0e80fd7..4a0e689 100644 --- a/pull_requests.py +++ b/pull_requests.py @@ -77,14 +77,10 @@ def process_pull_request(repo_url: str, pr_number: str) -> bool: first_comment_date = get_first_comment_date(comments) - commits = get_commits(repo_url, pr_number) - if len(commits) == 0: - # No commits, can't extract triplet - return False - - # filter out the commits that are older than the first comment, since they are the commits relevant for the PR - actual_commits = get_useful_commits(commits, first_comment_date) + # get commits and filter out the ones that are older than the first + # comment, since they are the commits relevant for the PR + actual_commits = get_useful_commits(get_commits(repo_url, pr_number), first_comment_date) if len(actual_commits) == 0: # No commits after the first comment, there were no revision from the contributor, so no triplet