Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 Blink. | 5 """Top-level presubmit script for Blink. |
| 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 |
| 11 import os | |
| 11 import sys | 12 import sys |
| 12 | 13 |
| 13 | 14 |
| 14 _EXCLUDED_PATHS = () | 15 _EXCLUDED_PATHS = () |
| 15 | 16 |
| 16 | 17 |
| 17 def _CheckForVersionControlConflictsInFile(input_api, f): | 18 def _CheckForVersionControlConflictsInFile(input_api, f): |
| 18 pattern = input_api.re.compile('^(?:<<<<<<<|>>>>>>>) |^=======$') | 19 pattern = input_api.re.compile('^(?:<<<<<<<|>>>>>>>) |^=======$') |
| 19 errors = [] | 20 errors = [] |
| 20 for line_num, line in f.ChangedContents(): | 21 for line_num, line in f.ChangedContents(): |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 if not errs: | 107 if not errs: |
| 107 return [output_api.PresubmitError( | 108 return [output_api.PresubmitError( |
| 108 "lint-test-expectations failed " | 109 "lint-test-expectations failed " |
| 109 "to produce output; check by hand. ")] | 110 "to produce output; check by hand. ")] |
| 110 if errs.strip() != 'Lint succeeded.': | 111 if errs.strip() != 'Lint succeeded.': |
| 111 return [output_api.PresubmitError(errs)] | 112 return [output_api.PresubmitError(errs)] |
| 112 return [] | 113 return [] |
| 113 | 114 |
| 114 | 115 |
| 115 def _CheckStyle(input_api, output_api): | 116 def _CheckStyle(input_api, output_api): |
| 117 # These files were moved from Chromium side (crbug/548254). | |
| 118 # TODO(hajimehoshi): We aim to remove these files since these are glue files | |
| 119 # and no longer needed. | |
|
kinuko
2016/02/04 11:25:34
If we're going to use this list for more files tha
hajimehoshi
2016/02/04 12:17:52
Done.
| |
| 120 ignore = [ | |
| 121 'third_party/WebKit/Source/platform/WebMemoryAllocatorDumpImpl', | |
| 122 'third_party/WebKit/Source/platform/WebMemoryDumpProviderAdapter', | |
| 123 'third_party/WebKit/Source/platform/WebProcessMemoryDumpImpl', | |
| 124 ] | |
| 125 files = [] | |
| 126 for f in input_api.AffectedFiles(): | |
| 127 if any([f.LocalPath().startswith(os.path.normpath(d)) for d in ignore]): | |
| 128 continue | |
| 129 files.append(f.LocalPath()) | |
| 130 | |
| 116 style_checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | 131 style_checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(), |
| 117 'Tools', 'Scripts', 'check-webkit-style') | 132 'Tools', 'Scripts', 'check-webkit-style') |
| 118 args = ([input_api.python_executable, style_checker_path, '--diff-files'] | 133 args = ([input_api.python_executable, style_checker_path, '--diff-files'] |
| 119 + [input_api.os_path.join('..', '..', f.LocalPath()) | 134 + [input_api.os_path.join('..', '..', f) for f in files]) |
| 120 for f in input_api.AffectedFiles()]) | |
| 121 results = [] | 135 results = [] |
| 122 | 136 |
| 123 try: | 137 try: |
| 124 child = input_api.subprocess.Popen(args, | 138 child = input_api.subprocess.Popen(args, |
| 125 stderr=input_api.subprocess.PIPE) | 139 stderr=input_api.subprocess.PIPE) |
| 126 _, stderrdata = child.communicate() | 140 _, stderrdata = child.communicate() |
| 127 if child.returncode != 0: | 141 if child.returncode != 0: |
| 128 results.append(output_api.PresubmitError( | 142 results.append(output_api.PresubmitError( |
| 129 'check-webkit-style failed', [stderrdata])) | 143 'check-webkit-style failed', [stderrdata])) |
| 130 except Exception as e: | 144 except Exception as e: |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 for master in masters: | 310 for master in masters: |
| 297 try_config.setdefault(master, {}) | 311 try_config.setdefault(master, {}) |
| 298 for builder in masters[master]: | 312 for builder in masters[master]: |
| 299 # Do not trigger presubmit builders, since they're likely to fail | 313 # Do not trigger presubmit builders, since they're likely to fail |
| 300 # (e.g. OWNERS checks before finished code review), and we're | 314 # (e.g. OWNERS checks before finished code review), and we're |
| 301 # running local presubmit anyway. | 315 # running local presubmit anyway. |
| 302 if 'presubmit' not in builder: | 316 if 'presubmit' not in builder: |
| 303 try_config[master][builder] = ['defaulttests'] | 317 try_config[master][builder] = ['defaulttests'] |
| 304 | 318 |
| 305 return try_config | 319 return try_config |
| OLD | NEW |