[email protected] | 75e10ff | 2012-09-04 23:54:13 | [diff] [blame] | 1 | # Copyright (c) 2012 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 isolate. |
| 6 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 8 | details on the presubmit API built into gcl. |
| 9 | """ |
| 10 | |
| 11 | |
| 12 | def CommonChecks(input_api, output_api): |
| 13 | output = [] |
| 14 | disabled_warnings = [ |
[email protected] | bb06d4e | 2012-09-10 20:47:20 | [diff] [blame] | 15 | 'F0401', # Unable to import module |
[email protected] | 75e10ff | 2012-09-04 23:54:13 | [diff] [blame] | 16 | 'R0401', # Cyclic import |
| 17 | 'W0613', # Unused argument |
| 18 | 'E1103', # subprocess.communicate() generates these :( |
[email protected] | bb06d4e | 2012-09-10 20:47:20 | [diff] [blame] | 19 | 'R0201', # method could be function (doesn't reference self) |
[email protected] | 75e10ff | 2012-09-04 23:54:13 | [diff] [blame] | 20 | ] |
[email protected] | ae8c433c6 | 2012-10-30 20:38:30 | [diff] [blame^] | 21 | black_list = [ |
| 22 | r'src[\\\/]build_tools[\\\/]tests[\\\/].*', |
| 23 | r'src[\\\/]build_tools[\\\/]sdk_tools[\\\/]third_party[\\\/].*', |
| 24 | ] |
[email protected] | 75e10ff | 2012-09-04 23:54:13 | [diff] [blame] | 25 | canned = input_api.canned_checks |
| 26 | output.extend(canned.RunPylint(input_api, output_api, black_list=black_list, |
| 27 | disabled_warnings=disabled_warnings)) |
| 28 | return output |
| 29 | |
| 30 | |
| 31 | def CheckChangeOnUpload(input_api, output_api): |
| 32 | return CommonChecks(input_api, output_api) |
| 33 | |
| 34 | |
| 35 | def CheckChangeOnCommit(input_api, output_api): |
| 36 | return CommonChecks(input_api, output_api) |
[email protected] | 356aa54 | 2012-09-19 23:31:29 | [diff] [blame] | 37 | |
| 38 | |
| 39 | def GetPreferredTrySlaves(project, change): |
| 40 | return ['linux_nacl_sdk', 'win_nacl_sdk', 'mac_nacl_sdk'] |