| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 """Top-level presubmit script for isolate. | 5 """Top-level presubmit script for isolate. |
| 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 gcl. | 8 details on the presubmit API built into gcl. |
| 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 disabled_warnings = [ | 14 disabled_warnings = [ |
| 15 'F0401', # Unable to import module |
| 15 'R0401', # Cyclic import | 16 'R0401', # Cyclic import |
| 16 'W0613', # Unused argument | 17 'W0613', # Unused argument |
| 17 'E1103', # subprocess.communicate() generates these :( | 18 'E1103', # subprocess.communicate() generates these :( |
| 19 'R0201', # method could be function (doesn't reference self) |
| 18 ] | 20 ] |
| 19 black_list = [r'src/site_scons/.*', | 21 black_list = [r'src/build_tools/tests/.*', |
| 20 r'.*/decode_dump.py', | 22 r'src/site_scons/.*', |
| 21 r'src/build_tools/build_sdk.py', | 23 ] |
| 22 r'src/build_tools/buildbot_common.py', | |
| 23 r'src/build_tools/buildbot_run.py', | |
| 24 r'src/build_tools/build_utils.py', | |
| 25 r'src/build_tools/build_updater.py', | |
| 26 r'src/build_tools/manifest_util.py', | |
| 27 r'src/build_tools/nacl*', | |
| 28 r'src/build_tools/generate_make.py', | |
| 29 r'src/build_tools/sdk_tools/sdk_update_main.py', | |
| 30 r'src/build_tools/sdk_tools/sdk_update.py', | |
| 31 r'src/project_templates', | |
| 32 r'.*/update_manifest.py', | |
| 33 r'.*/update_nacl_manifest.py', | |
| 34 r'src/build_tools/tests/.*'] | |
| 35 canned = input_api.canned_checks | 24 canned = input_api.canned_checks |
| 36 output.extend(canned.RunPylint(input_api, output_api, black_list=black_list, | 25 output.extend(canned.RunPylint(input_api, output_api, black_list=black_list, |
| 37 disabled_warnings=disabled_warnings)) | 26 disabled_warnings=disabled_warnings)) |
| 38 return output | 27 return output |
| 39 | 28 |
| 40 | 29 |
| 41 def CheckChangeOnUpload(input_api, output_api): | 30 def CheckChangeOnUpload(input_api, output_api): |
| 42 return CommonChecks(input_api, output_api) | 31 return CommonChecks(input_api, output_api) |
| 43 | 32 |
| 44 | 33 |
| 45 def CheckChangeOnCommit(input_api, output_api): | 34 def CheckChangeOnCommit(input_api, output_api): |
| 46 return CommonChecks(input_api, output_api) | 35 return CommonChecks(input_api, output_api) |
| OLD | NEW |