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 cc. | 5 """Top-level presubmit script for cc. |
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 results += CheckAsserts(input_api, output_api) | 316 results += CheckAsserts(input_api, output_api) |
317 results += CheckStdAbs(input_api, output_api) | 317 results += CheckStdAbs(input_api, output_api) |
318 results += CheckPassByValue(input_api, output_api) | 318 results += CheckPassByValue(input_api, output_api) |
319 results += CheckChangeLintsClean(input_api, output_api) | 319 results += CheckChangeLintsClean(input_api, output_api) |
320 results += CheckTodos(input_api, output_api) | 320 results += CheckTodos(input_api, output_api) |
321 results += CheckDoubleAngles(input_api, output_api) | 321 results += CheckDoubleAngles(input_api, output_api) |
322 results += CheckUniquePtr(input_api, output_api) | 322 results += CheckUniquePtr(input_api, output_api) |
323 results += CheckNamespace(input_api, output_api) | 323 results += CheckNamespace(input_api, output_api) |
324 results += CheckForUseOfWrongClock(input_api, output_api) | 324 results += CheckForUseOfWrongClock(input_api, output_api) |
325 results += FindUselessIfdefs(input_api, output_api) | 325 results += FindUselessIfdefs(input_api, output_api) |
326 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | |
327 return results | 326 return results |
328 | 327 |
329 def PostUploadHook(cl, change, output_api): | 328 def PostUploadHook(cl, change, output_api): |
330 """git cl upload will call this hook after the issue is created/modified. | 329 """git cl upload will call this hook after the issue is created/modified. |
331 | 330 |
332 This hook adds extra try bots list to the CL description in order to run | 331 This hook adds extra try bots list to the CL description in order to run |
333 Blink tests in addition to CQ try bots. | 332 Blink tests in addition to CQ try bots. |
334 """ | 333 """ |
335 rietveld_obj = cl.RpcServer() | 334 rietveld_obj = cl.RpcServer() |
336 issue = cl.issue | 335 issue = cl.issue |
337 description = rietveld_obj.get_description(issue) | 336 description = rietveld_obj.get_description(issue) |
338 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): | 337 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): |
339 return [] | 338 return [] |
340 | 339 |
341 bots = [ | 340 bots = [ |
342 'master.tryserver.blink:linux_trusty_blink_rel', | 341 'master.tryserver.blink:linux_trusty_blink_rel', |
343 ] | 342 ] |
344 | 343 |
345 results = [] | 344 results = [] |
346 new_description = description | 345 new_description = description |
347 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) | 346 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) |
348 results.append(output_api.PresubmitNotifyResult( | 347 results.append(output_api.PresubmitNotifyResult( |
349 'Automatically added Blink trybots to run Blink tests on CQ.')) | 348 'Automatically added Blink trybots to run Blink tests on CQ.')) |
350 | 349 |
351 if new_description != description: | 350 if new_description != description: |
352 rietveld_obj.update_description(issue, new_description) | 351 rietveld_obj.update_description(issue, new_description) |
353 | 352 |
354 return results | 353 return results |
OLD | NEW |