OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. 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 | 5 |
6 """Top-level presubmit script for GYP. | 6 """Top-level presubmit script for GYP. |
7 | 7 |
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
9 for more details about the presubmit API built into gcl. | 9 for more details about the presubmit API built into gcl. |
10 """ | 10 """ |
11 | 11 |
12 | 12 |
13 PYLINT_BLACKLIST = [ | 13 PYLINT_BLACKLIST = [ |
14 # TODO: fix me. | 14 # TODO: fix me. |
15 # From SCons, not done in google style. | 15 # From SCons, not done in google style. |
16 'test/lib/TestCmd.py', | 16 'test/lib/TestCmd.py', |
17 'test/lib/TestCommon.py', | 17 'test/lib/TestCommon.py', |
18 'test/lib/TestGyp.py', | 18 'test/lib/TestGyp.py', |
19 ] | 19 ] |
20 | 20 |
21 | 21 |
22 PYLINT_DISABLED_WARNINGS = [ | 22 PYLINT_DISABLED_WARNINGS = [ |
23 # TODO: fix me. | 23 # TODO: fix me. |
24 # Many tests include modules they don't use. | 24 # Many tests include modules they don't use. |
25 'W0611', | 25 'W0611', |
| 26 # Possible unbalanced tuple unpacking with sequence. |
| 27 'W0632', |
| 28 # Attempting to unpack a non-sequence. |
| 29 'W0633', |
26 # Include order doesn't properly include local files? | 30 # Include order doesn't properly include local files? |
27 'F0401', | 31 'F0401', |
28 # Some use of built-in names. | 32 # Some use of built-in names. |
29 'W0622', | 33 'W0622', |
30 # Some unused variables. | 34 # Some unused variables. |
31 'W0612', | 35 'W0612', |
32 # Operator not preceded/followed by space. | 36 # Operator not preceded/followed by space. |
33 'C0323', | 37 'C0323', |
34 'C0322', | 38 'C0322', |
35 # Unnecessary semicolon. | 39 # Unnecessary semicolon. |
36 'W0301', | 40 'W0301', |
37 # Unused argument. | 41 # Unused argument. |
38 'W0613', | 42 'W0613', |
39 # String has no effect (docstring in wrong place). | 43 # String has no effect (docstring in wrong place). |
40 'W0105', | 44 'W0105', |
| 45 # map/filter on lambda could be replaced by comprehension. |
| 46 'W0110', |
| 47 # Use of eval. |
| 48 'W0123', |
41 # Comma not followed by space. | 49 # Comma not followed by space. |
42 'C0324', | 50 'C0324', |
43 # Access to a protected member. | 51 # Access to a protected member. |
44 'W0212', | 52 'W0212', |
45 # Bad indent. | 53 # Bad indent. |
46 'W0311', | 54 'W0311', |
47 # Line too long. | 55 # Line too long. |
48 'C0301', | 56 'C0301', |
49 # Undefined variable. | 57 # Undefined variable. |
50 'E0602', | 58 'E0602', |
51 # Not exception type specified. | 59 # Not exception type specified. |
52 'W0702', | 60 'W0702', |
53 # No member of that name. | 61 # No member of that name. |
54 'E1101', | 62 'E1101', |
55 # Dangerous default {}. | 63 # Dangerous default {}. |
56 'W0102', | 64 'W0102', |
| 65 # Cyclic import. |
| 66 'R0401', |
57 # Others, too many to sort. | 67 # Others, too many to sort. |
58 'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231', | 68 'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231', |
59 'R0201', 'E0101', 'C0321', | 69 'R0201', 'E0101', 'C0321', |
60 # ************* Module copy | 70 # ************* Module copy |
61 # W0104:427,12:_test.odict.__setitem__: Statement seems to have no effect | 71 # W0104:427,12:_test.odict.__setitem__: Statement seems to have no effect |
62 'W0104', | 72 'W0104', |
63 ] | 73 ] |
64 | 74 |
65 | 75 |
66 def CheckChangeOnUpload(input_api, output_api): | 76 def CheckChangeOnUpload(input_api, output_api): |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 output_api, | 119 output_api, |
110 black_list=blacklist, | 120 black_list=blacklist, |
111 disabled_warnings=PYLINT_DISABLED_WARNINGS)) | 121 disabled_warnings=PYLINT_DISABLED_WARNINGS)) |
112 finally: | 122 finally: |
113 sys.path = old_sys_path | 123 sys.path = old_sys_path |
114 return report | 124 return report |
115 | 125 |
116 | 126 |
117 def GetPreferredTrySlaves(): | 127 def GetPreferredTrySlaves(): |
118 return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac', 'gyp-android'] | 128 return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac', 'gyp-android'] |
OLD | NEW |