blob: a6311f47889a4d581aa6bc933cf4c4af2d47e4a3 [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
Jonathan Backer16cd5362018-01-17 17:00:1011def 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
20 disabled_warnings = [
21 'W0622', # redefined-builtin
22 'R0923', # interface-not-implemented
23 ]
24 output.extend(input_api.canned_checks.RunPylint(
25 input_api,
26 output_api,
27 disabled_warnings=disabled_warnings))
28 finally:
29 sys.path = sys_path_backup
30
31 return output
32
33
34def CheckChangeOnUpload(input_api, output_api):
35 return CommonChecks(input_api, output_api)
36
37
38def CheckChangeOnCommit(input_api, output_api):
39 return CommonChecks(input_api, output_api)