Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: presubmit_canned_checks.py

Issue 215153004: For determining OWNERS, drop reviewers specified via '-r' that aren't in email address format. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index a48a0c627de361c6927477c7734bf2b7ab29a543..7bb49dd51af1354fe5961d579bb9bb5fabf965c8 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -852,6 +852,13 @@ def _GetRietveldIssueProps(input_api, messages):
issue=int(issue), messages=messages)
+def _EnsureEmailFormat(reviewer):
+ """Converts |reviewer| into an email address if it is not one already."""
+ if '@' in reviewer:
+ return reviewer
+ return reviewer + '@chromium.org'
+
+
def _ReviewersFromChange(change):
"""Return the reviewers specified in the |change|, if any."""
reviewers = set()
@@ -859,7 +866,7 @@ def _ReviewersFromChange(change):
reviewers.update(set([r.strip() for r in change.R.split(',')]))
if change.TBR:
reviewers.update(set([r.strip() for r in change.TBR.split(',')]))
- return reviewers
+ return set([_EnsureEmailFormat(reviewer) for reviewer in reviewers])
M-A Ruel 2014/03/28 00:19:35 FTR; return set(_EnsureEmailFormat(reviewer) for r
Ilya Sherman 2014/04/09 01:34:59 Done.
def _RietveldOwnerAndReviewers(input_api, email_regexp, approval_needed=False):
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698