OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 results.extend(_CheckForInvalidOSMacros(input_api, output_api)) | 1053 results.extend(_CheckForInvalidOSMacros(input_api, output_api)) |
1054 results.extend(_CheckAddedDepsHaveTargetApprovals(input_api, output_api)) | 1054 results.extend(_CheckAddedDepsHaveTargetApprovals(input_api, output_api)) |
1055 results.extend( | 1055 results.extend( |
1056 input_api.canned_checks.CheckChangeHasNoTabs( | 1056 input_api.canned_checks.CheckChangeHasNoTabs( |
1057 input_api, | 1057 input_api, |
1058 output_api, | 1058 output_api, |
1059 source_file_filter=lambda x: x.LocalPath().endswith('.grd'))) | 1059 source_file_filter=lambda x: x.LocalPath().endswith('.grd'))) |
1060 results.extend(_CheckSpamLogging(input_api, output_api)) | 1060 results.extend(_CheckSpamLogging(input_api, output_api)) |
1061 results.extend(_CheckForAnonymousVariables(input_api, output_api)) | 1061 results.extend(_CheckForAnonymousVariables(input_api, output_api)) |
1062 results.extend(_CheckCygwinShell(input_api, output_api)) | 1062 results.extend(_CheckCygwinShell(input_api, output_api)) |
1063 results.extend(_CheckJavaStyle(input_api, output_api)) | |
1064 | 1063 |
1065 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): | 1064 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): |
1066 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 1065 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
1067 input_api, output_api, | 1066 input_api, output_api, |
1068 input_api.PresubmitLocalPath(), | 1067 input_api.PresubmitLocalPath(), |
1069 whitelist=[r'^PRESUBMIT_test\.py$'])) | 1068 whitelist=[r'^PRESUBMIT_test\.py$'])) |
1070 return results | 1069 return results |
1071 | 1070 |
1072 | 1071 |
1073 def _CheckSubversionConfig(input_api, output_api): | 1072 def _CheckSubversionConfig(input_api, output_api): |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 return [] | 1198 return [] |
1200 | 1199 |
1201 return [output_api.PresubmitError( | 1200 return [output_api.PresubmitError( |
1202 'Possibly invalid OS macro[s] found. Please fix your code\n' | 1201 'Possibly invalid OS macro[s] found. Please fix your code\n' |
1203 'or add your macro to src/PRESUBMIT.py.', bad_macros)] | 1202 'or add your macro to src/PRESUBMIT.py.', bad_macros)] |
1204 | 1203 |
1205 | 1204 |
1206 def CheckChangeOnUpload(input_api, output_api): | 1205 def CheckChangeOnUpload(input_api, output_api): |
1207 results = [] | 1206 results = [] |
1208 results.extend(_CommonChecks(input_api, output_api)) | 1207 results.extend(_CommonChecks(input_api, output_api)) |
| 1208 results.extend(_CheckJavaStyle(input_api, output_api)) |
1209 return results | 1209 return results |
1210 | 1210 |
1211 | 1211 |
1212 def GetDefaultTryConfigs(bots=None): | 1212 def GetDefaultTryConfigs(bots=None): |
1213 """Returns a list of ('bot', set(['tests']), optionally filtered by [bots]. | 1213 """Returns a list of ('bot', set(['tests']), optionally filtered by [bots]. |
1214 | 1214 |
1215 To add tests to this list, they MUST be in the the corresponding master's | 1215 To add tests to this list, they MUST be in the the corresponding master's |
1216 gatekeeper config. For example, anything on master.chromium would be closed by | 1216 gatekeeper config. For example, anything on master.chromium would be closed by |
1217 tools/build/masters/master.chromium/master_gatekeeper_cfg.py. | 1217 tools/build/masters/master.chromium/master_gatekeeper_cfg.py. |
1218 | 1218 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 trybots.extend(GetDefaultTryConfigs(['cros_x86'])) | 1453 trybots.extend(GetDefaultTryConfigs(['cros_x86'])) |
1454 | 1454 |
1455 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1455 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
1456 # unless they're .gyp(i) files as changes to those files can break the gyp | 1456 # unless they're .gyp(i) files as changes to those files can break the gyp |
1457 # step on that bot. | 1457 # step on that bot. |
1458 if (not all(re.search('^chrome', f) for f in files) or | 1458 if (not all(re.search('^chrome', f) for f in files) or |
1459 any(re.search('\.gypi?$', f) for f in files)): | 1459 any(re.search('\.gypi?$', f) for f in files)): |
1460 trybots.extend(GetDefaultTryConfigs(['android_aosp'])) | 1460 trybots.extend(GetDefaultTryConfigs(['android_aosp'])) |
1461 | 1461 |
1462 return trybots | 1462 return trybots |
OLD | NEW |