summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-28 14:41:46 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-28 14:41:46 +0000
commit66daa70561c0849b575f50d459db494a6f8f1fc7 (patch)
tree85cf6d237dcd4f38cdd0654ff333f8f6bda4a78c /PRESUBMIT.py
parent3da71f86ad7b8b9764393ca50b917bc9ad4907da (diff)
downloadchromium_src-66daa70561c0849b575f50d459db494a6f8f1fc7.zip
chromium_src-66daa70561c0849b575f50d459db494a6f8f1fc7.tar.gz
chromium_src-66daa70561c0849b575f50d459db494a6f8f1fc7.tar.bz2
Make sure non chromite/googler contributor is listed in AUTHORS.
It's easy to get a non-committer patch in with the commit-queue. Verifying CLA is outside the scope of this change. BUG= TEST= Review URL: http://codereview.chromium.org/6794027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 6c093c9..45ec784 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -44,6 +44,7 @@ def _CommonChecks(input_api, output_api):
results.extend(input_api.canned_checks.PanProjectChecks(
input_api, output_api, excluded_paths=_EXCLUDED_PATHS))
results.extend(_CheckNoInterfacesInBase(input_api, output_api))
+ results.extend(_CheckAuthorizedAuthor(input_api, output_api))
return results
@@ -91,6 +92,31 @@ def _CheckSubversionConfig(input_api, output_api):
return []
+def _CheckAuthorizedAuthor(input_api, output_api):
+ """For non-googler/chromites committers, verify the author's email address is
+ in AUTHORS.
+ """
+ author = input_api.change.author_email
+ if (author is None or author.endswith('@chromium.org') or
+ author.endswith('@google.com')):
+ return []
+ authors_path = input_apit.os_path.join(
+ input_api.PresubmitLocalPath(), 'AUTHORS')
+ valid_authors = (
+ input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line)
+ for line in open(authors_path))
+ valid_authors = [item.group(1) for item in valid_authors if item]
+ if not author in valid_authors:
+ return [output_api.PresubmitPromptWarning(
+ ('%s is not in AUTHORS file. If you are a new contributor, please visit'
+ '\n'
+ 'http://www.chromium.org/developers/contributing-code and read the '
+ '"Legal" section\n'
+ 'If you are a chromite, verify the contributor signed the CLA.') %
+ author)]
+ return []
+
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))