| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Presubmit script for mojo | 5 """Presubmit script for mojo |
| 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 depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 def _CheckSourceSetsAreOfCorrectType(input_api, output_api, package): | 187 def _CheckSourceSetsAreOfCorrectType(input_api, output_api, package): |
| 188 """Makes sure that the BUILD.gn files always use the correct wrapper type for | 188 """Makes sure that the BUILD.gn files always use the correct wrapper type for |
| 189 |package|, which can be one of ["SDK", "EDK"], to construct source_set | 189 |package|, which can be one of ["SDK", "EDK"], to construct source_set |
| 190 targets.""" | 190 targets.""" |
| 191 assert package in _PACKAGE_SOURCE_SET_TYPES | 191 assert package in _PACKAGE_SOURCE_SET_TYPES |
| 192 required_source_set_type = _PACKAGE_SOURCE_SET_TYPES[package] | 192 required_source_set_type = _PACKAGE_SOURCE_SET_TYPES[package] |
| 193 | 193 |
| 194 problems = [] | 194 problems = [] |
| 195 for f in _AffectedBuildFilesWithinPackage(input_api, package): | 195 for f in _AffectedBuildFilesWithinPackage(input_api, package): |
| 196 if f.LocalPath() == "mojo/public/tools/bindings/mojom.gni": |
| 197 continue |
| 196 for line_num, line in f.ChangedContents(): | 198 for line_num, line in f.ChangedContents(): |
| 197 m = re.search(r"[a-z_]*source_set\(", line) | 199 m = re.search(r"[a-z_]*source_set\(", line) |
| 198 if not m: | 200 if not m: |
| 199 continue | 201 continue |
| 200 source_set_type = m.group(0)[:-1] | 202 source_set_type = m.group(0)[:-1] |
| 201 if source_set_type in required_source_set_type: | 203 if source_set_type in required_source_set_type: |
| 202 continue | 204 continue |
| 203 problems.append(_IncorrectSourceSetTypeWarningItem(f.LocalPath(), | 205 problems.append(_IncorrectSourceSetTypeWarningItem(f.LocalPath(), |
| 204 line_num)) | 206 line_num)) |
| 205 | 207 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 def CheckChangeOnUpload(input_api, output_api): | 280 def CheckChangeOnUpload(input_api, output_api): |
| 279 results = [] | 281 results = [] |
| 280 results.extend(_CommonChecks(input_api, output_api)) | 282 results.extend(_CommonChecks(input_api, output_api)) |
| 281 results.extend(_CheckChangePylintsClean(input_api, output_api)) | 283 results.extend(_CheckChangePylintsClean(input_api, output_api)) |
| 282 return results | 284 return results |
| 283 | 285 |
| 284 def CheckChangeOnCommit(input_api, output_api): | 286 def CheckChangeOnCommit(input_api, output_api): |
| 285 results = [] | 287 results = [] |
| 286 results.extend(_CommonChecks(input_api, output_api)) | 288 results.extend(_CommonChecks(input_api, output_api)) |
| 287 return results | 289 return results |
| OLD | NEW |