From ac34821d377b40b9a339c93eb693d09da53a2481 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Fri, 5 Feb 2021 22:38:38 +0000 Subject: [PATCH] presubmit: Make email_regexp argument optional. Make email_regexp argument to GetCodeReviewOwnerAndReviewers optional. This will make it possible to remove it from downstream PRESUBMIT.py scripts that pass it. Change-Id: I45168c1f4137e7e797b30d050e4ee82f6e26daf3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2679763 Reviewed-by: Josip Sokcevic Commit-Queue: Josip Sokcevic Auto-Submit: Edward Lesmes --- presubmit_canned_checks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index b5db7ca0d..16c149765 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1145,7 +1145,7 @@ def CheckOwners( affected_files = set([f.LocalPath() for f in input_api.change.AffectedFiles(file_filter=source_file_filter)]) owner_email, reviewers = GetCodereviewOwnerAndReviewers( - input_api, None, approval_needed=input_api.is_committing) + input_api, approval_needed=input_api.is_committing) owner_email = owner_email or input_api.change.author_email @@ -1194,7 +1194,8 @@ def CheckOwners( return [] -def GetCodereviewOwnerAndReviewers(input_api, _email_regexp, approval_needed): +def GetCodereviewOwnerAndReviewers( + input_api, _email_regexp=None, approval_needed=True): """Return the owner and reviewers of a change, if any. If approval_needed is True, only reviewers who have approved the change