| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Top-level presubmit script for Chromium. | 5 """Top-level presubmit script for Chromium. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 """ | 98 """ |
| 99 author = input_api.change.author_email | 99 author = input_api.change.author_email |
| 100 if (author is None or author.endswith('@chromium.org') or | 100 if (author is None or author.endswith('@chromium.org') or |
| 101 author.endswith('@google.com')): | 101 author.endswith('@google.com')): |
| 102 return [] | 102 return [] |
| 103 authors_path = input_api.os_path.join( | 103 authors_path = input_api.os_path.join( |
| 104 input_api.PresubmitLocalPath(), 'AUTHORS') | 104 input_api.PresubmitLocalPath(), 'AUTHORS') |
| 105 valid_authors = ( | 105 valid_authors = ( |
| 106 input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line) | 106 input_api.re.match(r'[^#]+\s+\<(.+?)\>\s*$', line) |
| 107 for line in open(authors_path)) | 107 for line in open(authors_path)) |
| 108 valid_authors = [item.group(1) for item in valid_authors if item] | 108 valid_authors = [item.group(1).lower() for item in valid_authors if item] |
| 109 if not author in valid_authors: | 109 if not author.lower() in valid_authors: |
| 110 return [output_api.PresubmitPromptWarning( | 110 return [output_api.PresubmitPromptWarning( |
| 111 ('%s is not in AUTHORS file. If you are a new contributor, please visit' | 111 ('%s is not in AUTHORS file. If you are a new contributor, please visit' |
| 112 '\n' | 112 '\n' |
| 113 'http://www.chromium.org/developers/contributing-code and read the ' | 113 'http://www.chromium.org/developers/contributing-code and read the ' |
| 114 '"Legal" section\n' | 114 '"Legal" section\n' |
| 115 'If you are a chromite, verify the contributor signed the CLA.') % | 115 'If you are a chromite, verify the contributor signed the CLA.') % |
| 116 author)] | 116 author)] |
| 117 return [] | 117 return [] |
| 118 | 118 |
| 119 | 119 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 141 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 141 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 142 input_api, output_api)) | 142 input_api, output_api)) |
| 143 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 143 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
| 144 input_api, output_api)) | 144 input_api, output_api)) |
| 145 results.extend(_CheckSubversionConfig(input_api, output_api)) | 145 results.extend(_CheckSubversionConfig(input_api, output_api)) |
| 146 return results | 146 return results |
| 147 | 147 |
| 148 | 148 |
| 149 def GetPreferredTrySlaves(): | 149 def GetPreferredTrySlaves(): |
| 150 return ['win', 'linux', 'mac'] | 150 return ['win', 'linux', 'mac'] |
| OLD | NEW |