blob: 5f0aeb5a610d4737b5fd9fd35fb920a379368abc [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
Fabrice de Gans7a4c68a2021-06-23 18:40:0311
12USE_PYTHON3 = True
13
14
Jonathan Backer16cd5362018-01-17 17:00:1015def CommonChecks(input_api, output_api):
16 import sys
17
18 output = []
19 sys_path_backup = sys.path
20 try:
21 sys.path = [
22 input_api.PresubmitLocalPath()
23 ] + sys.path
Kai Ninomiyaa388f4a12020-06-15 18:31:5124 output.extend(input_api.canned_checks.RunPylint(input_api, output_api))
Jonathan Backer16cd5362018-01-17 17:00:1025 finally:
26 sys.path = sys_path_backup
27
28 return output
29
30
31def CheckChangeOnUpload(input_api, output_api):
32 return CommonChecks(input_api, output_api)
33
34
35def CheckChangeOnCommit(input_api, output_api):
36 return CommonChecks(input_api, output_api)