OLD | NEW |
| (Empty) |
1 # Copyright 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 """Presubmit for blimp/tools.""" | |
6 | |
7 | |
8 def CommonChecks(input_api, output_api): | |
9 """Presubmit checks run on both upload and commit. | |
10 | |
11 This is currently limited to pylint. | |
12 """ | |
13 checks = [] | |
14 | |
15 blimp_tools_dir = input_api.PresubmitLocalPath() | |
16 | |
17 def J(*dirs): | |
18 """Returns a path relative to presubmit directory.""" | |
19 return input_api.os_path.join(blimp_tools_dir, *dirs) | |
20 | |
21 checks.extend(input_api.canned_checks.GetPylint( | |
22 input_api, | |
23 output_api, | |
24 pylintrc='pylintrc', | |
25 extra_paths_list=[ | |
26 J(), | |
27 J('..', '..', 'build', 'android'), | |
28 J('..', '..', 'third_party', 'catapult', 'devil') | |
29 ])) | |
30 | |
31 return input_api.RunTests(checks, False) | |
32 | |
33 | |
34 def CheckChangeOnUpload(input_api, output_api): | |
35 """Presubmit checks on CL upload.""" | |
36 return CommonChecks(input_api, output_api) | |
37 | |
38 | |
39 def CheckChangeOnCommit(input_api, output_api): | |
40 """Presubmit checks on commit.""" | |
41 return CommonChecks(input_api, output_api) | |
42 | |
OLD | NEW |