OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Presubmit script for android buildbot. | 5 """Presubmit script for android buildbot. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
8 details on the presubmit API built into depot_tools. | 8 details on the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
11 | 11 |
12 def CommonChecks(input_api, output_api): | 12 def CommonChecks(input_api, output_api): |
13 output = [] | 13 output = [] |
14 | 14 |
15 def J(*dirs): | 15 def J(*dirs): |
16 """Returns a path relative to presubmit directory.""" | 16 """Returns a path relative to presubmit directory.""" |
17 return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs) | 17 return input_api.os_path.join(input_api.PresubmitLocalPath(), *dirs) |
18 | 18 |
| 19 build_pys = [ |
| 20 r'gyp/.*\.py$', |
| 21 r'gn/.*\.py', |
| 22 r'incremental_install/.*\.py', |
| 23 ] |
19 output.extend(input_api.canned_checks.RunPylint( | 24 output.extend(input_api.canned_checks.RunPylint( |
20 input_api, | 25 input_api, |
21 output_api, | 26 output_api, |
22 pylintrc='pylintrc', | 27 pylintrc='pylintrc', |
23 black_list=[r'pylib/symbols/.*\.py$', r'gyp/.*\.py$', r'gn/.*\.py'], | 28 # symbols has its own PRESUBMIT.py |
| 29 black_list=build_pys + [r'pylib/symbols/.*\.py$'], |
24 extra_paths_list=[J(), J('buildbot')])) | 30 extra_paths_list=[J(), J('buildbot')])) |
25 output.extend(input_api.canned_checks.RunPylint( | 31 output.extend(input_api.canned_checks.RunPylint( |
26 input_api, | 32 input_api, |
27 output_api, | 33 output_api, |
28 white_list=[r'gyp/.*\.py$', r'gn/.*\.py'], | 34 white_list=build_pys, |
29 extra_paths_list=[J('gyp'), J('gn')])) | 35 extra_paths_list=[J('gyp'), J('gn')])) |
30 | 36 |
31 # Disabled due to http://crbug.com/410936 | 37 # Disabled due to http://crbug.com/410936 |
32 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 38 #output.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
33 #input_api, output_api, J('buildbot', 'tests'))) | 39 #input_api, output_api, J('buildbot', 'tests'))) |
34 | 40 |
35 pylib_test_env = dict(input_api.environ) | 41 pylib_test_env = dict(input_api.environ) |
36 pylib_test_env.update({ | 42 pylib_test_env.update({ |
37 'PYTHONPATH': input_api.PresubmitLocalPath(), | 43 'PYTHONPATH': input_api.PresubmitLocalPath(), |
38 'PYTHONDONTWRITEBYTECODE': '1', | 44 'PYTHONDONTWRITEBYTECODE': '1', |
(...skipping 16 matching lines...) Expand all Loading... |
55 env=pylib_test_env)) | 61 env=pylib_test_env)) |
56 return output | 62 return output |
57 | 63 |
58 | 64 |
59 def CheckChangeOnUpload(input_api, output_api): | 65 def CheckChangeOnUpload(input_api, output_api): |
60 return CommonChecks(input_api, output_api) | 66 return CommonChecks(input_api, output_api) |
61 | 67 |
62 | 68 |
63 def CheckChangeOnCommit(input_api, output_api): | 69 def CheckChangeOnCommit(input_api, output_api): |
64 return CommonChecks(input_api, output_api) | 70 return CommonChecks(input_api, output_api) |
OLD | NEW |