Chromium Code Reviews| 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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1102 [input_api.python_executable, idl_schema], | 1102 [input_api.python_executable, idl_schema], |
| 1103 stdin=input_api.subprocess.PIPE, | 1103 stdin=input_api.subprocess.PIPE, |
| 1104 stdout=input_api.subprocess.PIPE, | 1104 stdout=input_api.subprocess.PIPE, |
| 1105 stderr=input_api.subprocess.PIPE, | 1105 stderr=input_api.subprocess.PIPE, |
| 1106 universal_newlines=True) | 1106 universal_newlines=True) |
| 1107 (_, error) = process.communicate(input=contents) | 1107 (_, error) = process.communicate(input=contents) |
| 1108 return error or None | 1108 return error or None |
| 1109 except ValueError as e: | 1109 except ValueError as e: |
| 1110 return e | 1110 return e |
| 1111 | 1111 |
| 1112 | |
| 1113 def _CheckParseErrors(input_api, output_api): | 1112 def _CheckParseErrors(input_api, output_api): |
| 1114 """Check that IDL and JSON files do not contain syntax errors.""" | 1113 """Check that IDL and JSON files do not contain syntax errors.""" |
| 1115 actions = { | 1114 actions = { |
| 1116 '.idl': _GetIDLParseError, | 1115 '.idl': _GetIDLParseError, |
| 1117 '.json': _GetJSONParseError, | 1116 '.json': _GetJSONParseError, |
| 1118 } | 1117 } |
| 1119 # These paths contain test data and other known invalid JSON files. | 1118 # These paths contain test data and other known invalid JSON files. |
| 1120 excluded_patterns = [ | 1119 excluded_patterns = [ |
| 1121 'test/data/', | 1120 'test/data/', |
| 1122 '^components/policy/resources/policy_templates.json$', | 1121 '^components[\\\/]policy[\\\/]resources[\\\/]policy_templates.json$', |
|
Joao da Silva
2014/09/01 08:56:18
This has been fixed in https://codereview.chromium
Mike Lerman
2014/09/02 16:58:29
Perfect, just rebased. Thanks.
| |
| 1123 ] | 1122 ] |
| 1124 # Most JSON files are preprocessed and support comments, but these do not. | 1123 # Most JSON files are preprocessed and support comments, but these do not. |
| 1125 json_no_comments_patterns = [ | 1124 json_no_comments_patterns = [ |
| 1126 '^testing/', | 1125 '^testing/', |
| 1127 ] | 1126 ] |
| 1128 # Only run IDL checker on files in these directories. | 1127 # Only run IDL checker on files in these directories. |
| 1129 idl_included_patterns = [ | 1128 idl_included_patterns = [ |
| 1130 '^chrome/common/extensions/api/', | 1129 '^chrome/common/extensions/api/', |
| 1131 '^extensions/common/api/', | 1130 '^extensions/common/api/', |
| 1132 ] | 1131 ] |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1585 builders.extend(['cros_x86']) | 1584 builders.extend(['cros_x86']) |
| 1586 | 1585 |
| 1587 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1586 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
| 1588 # unless they're .gyp(i) files as changes to those files can break the gyp | 1587 # unless they're .gyp(i) files as changes to those files can break the gyp |
| 1589 # step on that bot. | 1588 # step on that bot. |
| 1590 if (not all(re.search('^chrome', f) for f in files) or | 1589 if (not all(re.search('^chrome', f) for f in files) or |
| 1591 any(re.search('\.gypi?$', f) for f in files)): | 1590 any(re.search('\.gypi?$', f) for f in files)): |
| 1592 builders.extend(['android_aosp']) | 1591 builders.extend(['android_aosp']) |
| 1593 | 1592 |
| 1594 return GetDefaultTryConfigs(builders) | 1593 return GetDefaultTryConfigs(builders) |
| OLD | NEW |