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 cc. | 5 """Top-level presubmit script for cc. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
11 import re | 11 import re |
12 import string | 12 import string |
13 | 13 |
14 CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',) | 14 CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',) |
15 | 15 |
16 def CheckChangeLintsClean(input_api, output_api): | 16 def CheckChangeLintsClean(input_api, output_api): |
17 input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state | 17 input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state |
18 source_filter = lambda x: input_api.FilterSourceFile( | 18 source_filter = lambda x: input_api.FilterSourceFile( |
19 x, white_list=CC_SOURCE_FILES, black_list=None) | 19 x, white_list=CC_SOURCE_FILES, black_list=None) |
20 files = [f.AbsoluteLocalPath() for f in | 20 files = [f.AbsoluteLocalPath() for f in |
21 input_api.AffectedSourceFiles(source_filter)] | 21 input_api.AffectedSourceFiles(source_filter)] |
22 level = 1 # strict, but just warn | 22 level = 1 # strict, but just warn |
23 | 23 |
| 24 # TODO(danakj): Temporary, while the OVERRIDE and FINAL fixup is in progress. |
| 25 # crbug.com/422353 |
| 26 input_api.cpplint._SetFilters('-readability/inheritance') |
| 27 |
24 for file_name in files: | 28 for file_name in files: |
25 input_api.cpplint.ProcessFile(file_name, level) | 29 input_api.cpplint.ProcessFile(file_name, level) |
26 | 30 |
27 if not input_api.cpplint._cpplint_state.error_count: | 31 if not input_api.cpplint._cpplint_state.error_count: |
28 return [] | 32 return [] |
29 | 33 |
30 return [output_api.PresubmitPromptWarning( | 34 return [output_api.PresubmitPromptWarning( |
31 'Changelist failed cpplint.py check.')] | 35 'Changelist failed cpplint.py check.')] |
32 | 36 |
33 def CheckAsserts(input_api, output_api, white_list=CC_SOURCE_FILES, black_list=N
one): | 37 def CheckAsserts(input_api, output_api, white_list=CC_SOURCE_FILES, black_list=N
one): |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 return { | 372 return { |
369 'tryserver.blink': { | 373 'tryserver.blink': { |
370 'linux_blink_rel': set(['defaulttests']), | 374 'linux_blink_rel': set(['defaulttests']), |
371 }, | 375 }, |
372 'tryserver.chromium.gpu': { | 376 'tryserver.chromium.gpu': { |
373 'linux_gpu': set(['defaulttests']), | 377 'linux_gpu': set(['defaulttests']), |
374 'mac_gpu': set(['defaulttests']), | 378 'mac_gpu': set(['defaulttests']), |
375 'win_gpu': set(['defaulttests']), | 379 'win_gpu': set(['defaulttests']), |
376 }, | 380 }, |
377 } | 381 } |
OLD | NEW |