blob: b2b4d85830e1e0557d925d47a90e7f008618b2c4 [file] [log] [blame]
[email protected]75e10ff2012-09-04 23:54:131# 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
tfarina78bb92f42015-01-31 00:20:485"""Top-level presubmit script for native_client_sdk.
[email protected]75e10ff2012-09-04 23:54:136
tfarina78bb92f42015-01-31 00:20:487See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details on the presubmit API built into depot_tools.
[email protected]75e10ff2012-09-04 23:54:139"""
10
11
12def CommonChecks(input_api, output_api):
13 output = []
14 disabled_warnings = [
[email protected]bb06d4e2012-09-10 20:47:2015 'F0401', # Unable to import module
[email protected]75e10ff2012-09-04 23:54:1316 'R0401', # Cyclic import
17 'W0613', # Unused argument
binji3f178cf2014-12-18 23:33:5618 'W0403', # relative import warnings
[email protected]75e10ff2012-09-04 23:54:1319 'E1103', # subprocess.communicate() generates these :(
[email protected]bb06d4e2012-09-10 20:47:2020 'R0201', # method could be function (doesn't reference self)
[email protected]75e10ff2012-09-04 23:54:1321 ]
[email protected]ae8c433c62012-10-30 20:38:3022 black_list = [
23 r'src[\\\/]build_tools[\\\/]tests[\\\/].*',
24 r'src[\\\/]build_tools[\\\/]sdk_tools[\\\/]third_party[\\\/].*',
[email protected]862a2c02013-08-30 21:58:5325 r'src[\\\/]doc[\\\/]*',
[email protected]fe381f52013-10-31 18:11:5226 r'src[\\\/]gonacl_appengine[\\\/]*',
[email protected]ae8c433c62012-10-30 20:38:3027 ]
[email protected]75e10ff2012-09-04 23:54:1328 canned = input_api.canned_checks
29 output.extend(canned.RunPylint(input_api, output_api, black_list=black_list,
30 disabled_warnings=disabled_warnings))
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)