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 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 args += ['--file', f.LocalPath()] | 301 args += ['--file', f.LocalPath()] |
302 checkperms = input_api.subprocess.Popen( | 302 checkperms = input_api.subprocess.Popen( |
303 args, stdout=input_api.subprocess.PIPE) | 303 args, stdout=input_api.subprocess.PIPE) |
304 errors = checkperms.communicate()[0].strip() | 304 errors = checkperms.communicate()[0].strip() |
305 if errors: | 305 if errors: |
306 return [output_api.PresubmitError( | 306 return [output_api.PresubmitError( |
307 'checkperms.py failed.', errors.splitlines())] | 307 'checkperms.py failed.', errors.splitlines())] |
308 return [] | 308 return [] |
309 | 309 |
310 | 310 |
311 def _CheckForInvalidPreferenceError(input_api, output_api): | |
312 pattern = input_api.re.compile('Invalid name for preference: (.+)') | |
313 | |
314 for f in input_api.AffectedFiles(): | |
315 if not f.LocalPath().endswith('-expected.txt'): | |
316 continue | |
317 for line_num, line in f.ChangedContents(): | |
318 result = pattern.search(line) | |
319 if result: | |
320 return [output_api.PresubmitError('Found an invalid preference % s in expected result %s:%s' % (result.group(1), f, line_num))] | |
Dirk Pranke
2014/08/09 00:40:40
this bails out on the first error; it's perhaps be
Julien - ping for review
2014/08/11 15:57:55
Makes sense, changed to report all errors.
| |
321 return [] | |
322 | |
311 def CheckChangeOnUpload(input_api, output_api): | 323 def CheckChangeOnUpload(input_api, output_api): |
312 results = [] | 324 results = [] |
313 results.extend(_CommonChecks(input_api, output_api)) | 325 results.extend(_CommonChecks(input_api, output_api)) |
314 results.extend(_CheckStyle(input_api, output_api)) | 326 results.extend(_CheckStyle(input_api, output_api)) |
315 results.extend(_CheckForPrintfDebugging(input_api, output_api)) | 327 results.extend(_CheckForPrintfDebugging(input_api, output_api)) |
316 results.extend(_CheckForDangerousTestFunctions(input_api, output_api)) | 328 results.extend(_CheckForDangerousTestFunctions(input_api, output_api)) |
329 results.extend(_CheckForInvalidPreferenceError(input_api, output_api)) | |
317 return results | 330 return results |
318 | 331 |
319 | 332 |
320 def CheckChangeOnCommit(input_api, output_api): | 333 def CheckChangeOnCommit(input_api, output_api): |
321 results = [] | 334 results = [] |
322 results.extend(_CommonChecks(input_api, output_api)) | 335 results.extend(_CommonChecks(input_api, output_api)) |
323 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 336 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
324 input_api, output_api, | 337 input_api, output_api, |
325 json_url='http://blink-status.appspot.com/current?format=json')) | 338 json_url='http://blink-status.appspot.com/current?format=json')) |
326 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 339 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
(...skipping 15 matching lines...) Expand all Loading... | |
342 'mac_blink_rel': set(['defaulttests']), | 355 'mac_blink_rel': set(['defaulttests']), |
343 'win_blink_compile_dbg': set(['defaulttests']), | 356 'win_blink_compile_dbg': set(['defaulttests']), |
344 'win_blink_rel': set(['defaulttests']), | 357 'win_blink_rel': set(['defaulttests']), |
345 }, | 358 }, |
346 'tryserver.chromium.gpu': { | 359 'tryserver.chromium.gpu': { |
347 'linux_gpu': set(['defaulttests']), | 360 'linux_gpu': set(['defaulttests']), |
348 'mac_gpu': set(['defaulttests']), | 361 'mac_gpu': set(['defaulttests']), |
349 'win_gpu': set(['defaulttests']), | 362 'win_gpu': set(['defaulttests']), |
350 } | 363 } |
351 } | 364 } |
OLD | NEW |