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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 } | 72 } |
73 | 73 |
74 def _IsBuildFileWithinPackage(f, package): | 74 def _IsBuildFileWithinPackage(f, package): |
75 """Returns whether |f| specifies a GN build file within |package|.""" | 75 """Returns whether |f| specifies a GN build file within |package|.""" |
76 assert package in _PACKAGE_PATH_PREFIXES | 76 assert package in _PACKAGE_PATH_PREFIXES |
77 package_path_prefix = _PACKAGE_PATH_PREFIXES[package] | 77 package_path_prefix = _PACKAGE_PATH_PREFIXES[package] |
78 | 78 |
79 if not f.LocalPath().startswith(package_path_prefix): | 79 if not f.LocalPath().startswith(package_path_prefix): |
80 return False | 80 return False |
81 if (not f.LocalPath().endswith("/BUILD.gn") and | 81 if (not f.LocalPath().endswith("/BUILD.gn") and |
82 not f.LocalPath().endswith(".gni")): | 82 not f.LocalPath().endswith(".gni") or |
83 f.LocalPath() == "mojo/public/tools/bindings/mojom.gni"): | |
viettrungluu
2015/10/20 23:54:37
It seems unfortunate to hard-code this exception i
vardhan
2015/10/21 19:29:38
yeah it's kind weird, but i figured this is where
| |
83 return False | 84 return False |
84 if f.LocalPath() in _PACKAGE_IGNORED_BUILD_FILES[package]: | 85 if f.LocalPath() in _PACKAGE_IGNORED_BUILD_FILES[package]: |
85 return False | 86 return False |
86 return True | 87 return True |
87 | 88 |
88 def _AffectedBuildFilesWithinPackage(input_api, package): | 89 def _AffectedBuildFilesWithinPackage(input_api, package): |
89 """Returns all the affected build files within |package|.""" | 90 """Returns all the affected build files within |package|.""" |
90 return [f for f in input_api.AffectedFiles() | 91 return [f for f in input_api.AffectedFiles() |
91 if _IsBuildFileWithinPackage(f, package)] | 92 if _IsBuildFileWithinPackage(f, package)] |
92 | 93 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 def CheckChangeOnUpload(input_api, output_api): | 279 def CheckChangeOnUpload(input_api, output_api): |
279 results = [] | 280 results = [] |
280 results.extend(_CommonChecks(input_api, output_api)) | 281 results.extend(_CommonChecks(input_api, output_api)) |
281 results.extend(_CheckChangePylintsClean(input_api, output_api)) | 282 results.extend(_CheckChangePylintsClean(input_api, output_api)) |
282 return results | 283 return results |
283 | 284 |
284 def CheckChangeOnCommit(input_api, output_api): | 285 def CheckChangeOnCommit(input_api, output_api): |
285 results = [] | 286 results = [] |
286 results.extend(_CommonChecks(input_api, output_api)) | 287 results.extend(_CommonChecks(input_api, output_api)) |
287 return results | 288 return results |
OLD | NEW |