Avi Drissman | 05dfbc82 | 2022-09-13 21:25:34 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors |
kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Top-level presubmit script for gpu. |
| 6 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details about the presubmit API built into depot_tools. |
| 9 | """ |
| 10 | |
Brian Sheedy | d406c1a | 2022-06-07 00:03:16 | [diff] [blame] | 11 | import sys |
| 12 | |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame] | 13 | defCommonChecks(input_api, output_api): |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame] | 14 | |
| 15 | output=[] |
| 16 | sys_path_backup= sys.path |
| 17 | try: |
| 18 | sys.path=[ |
| 19 | input_api.PresubmitLocalPath() |
| 20 | ]+ sys.path |
Brian Sheedy | e31df482 | 2022-06-03 04:22:17 | [diff] [blame] | 21 | pylint_checks= input_api.canned_checks.GetPylint( |
| 22 | input_api, |
| 23 | output_api, |
| 24 | version='2.7') |
Brian Sheedy | d406c1a | 2022-06-07 00:03:16 | [diff] [blame] | 25 | output.extend(input_api.RunTests(pylint_checks)) |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame] | 26 | finally: |
| 27 | sys.path= sys_path_backup |
| 28 | |
| 29 | return output |
| 30 | |
| 31 | |
| 32 | defCheckChangeOnUpload(input_api, output_api): |
| 33 | returnCommonChecks(input_api, output_api) |
| 34 | |
| 35 | |
| 36 | defCheckChangeOnCommit(input_api, output_api): |
| 37 | returnCommonChecks(input_api, output_api) |