kbr | e85ee56 | 2016-02-09 04:37:35 | [diff] [blame] | 1 | # Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 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 | |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame] | 11 | def CommonChecks(input_api, output_api): |
| 12 | import sys |
| 13 | |
| 14 | output = [] |
| 15 | sys_path_backup = sys.path |
| 16 | try: |
| 17 | sys.path = [ |
| 18 | input_api.PresubmitLocalPath() |
| 19 | ] + sys.path |
Kai Ninomiya | a388f4a1 | 2020-06-15 18:31:51 | [diff] [blame] | 20 | output.extend(input_api.canned_checks.RunPylint(input_api, output_api)) |
Jonathan Backer | 16cd536 | 2018-01-17 17:00:10 | [diff] [blame] | 21 | finally: |
| 22 | sys.path = sys_path_backup |
| 23 | |
| 24 | return output |
| 25 | |
| 26 | |
| 27 | def CheckChangeOnUpload(input_api, output_api): |
| 28 | return CommonChecks(input_api, output_api) |
| 29 | |
| 30 | |
| 31 | def CheckChangeOnCommit(input_api, output_api): |
| 32 | return CommonChecks(input_api, output_api) |