blob: e6609ddbdc5ea3b08f3fcc1a34cb4172997c224e [file] [log] [blame]
kbre85ee562016-02-09 04:37:351# 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
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into depot_tools.
9"""
10
Brian Sheedyd406c1a2022-06-07 00:03:1611import sys
12
Fabrice de Gans7a4c68a2021-06-23 18:40:0313
14USE_PYTHON3 = True
15
16
Jonathan Backer16cd5362018-01-17 17:00:1017def CommonChecks(input_api, output_api):
Jonathan Backer16cd5362018-01-17 17:00:1018
19 output = []
20 sys_path_backup = sys.path
21 try:
22 sys.path = [
23 input_api.PresubmitLocalPath()
24 ] + sys.path
Brian Sheedye31df4822022-06-03 04:22:1725 pylint_checks = input_api.canned_checks.GetPylint(
26 input_api,
27 output_api,
28 version='2.7')
Brian Sheedyd406c1a2022-06-07 00:03:1629 output.extend(input_api.RunTests(pylint_checks))
Jonathan Backer16cd5362018-01-17 17:00:1030 finally:
31 sys.path = sys_path_backup
32
33 return output
34
35
36def CheckChangeOnUpload(input_api, output_api):
37 return CommonChecks(input_api, output_api)
38
39
40def CheckChangeOnCommit(input_api, output_api):
41 return CommonChecks(input_api, output_api)