OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Presubmit script for app_list. | 5 """Presubmit script for app_list. |
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 INCLUDE_CPP_FILES_ONLY = ( | 11 INCLUDE_CPP_FILES_ONLY = ( |
11 r'.*\.cc$', r'.*\.h$' | 12 r'.*\.cc$', r'.*\.h$' |
12 ) | 13 ) |
13 | 14 |
15 EXCLUDE = ( | |
16 # Objective C confuses everything. | |
17 r'.*cocoa.*', | |
18 r'.*_mac\.(cc|h)$', | |
tapted
2014/12/12 00:12:42
a foo_mac.cc file won't have any Objective C in it
tfarina
2014/12/12 00:21:28
Done.
| |
19 r'.*_mac_.*', | |
20 ) | |
21 | |
14 def CheckChangeLintsClean(input_api, output_api): | 22 def CheckChangeLintsClean(input_api, output_api): |
15 """Makes sure that the ui/app_list/ code is cpplint clean.""" | 23 """Makes sure that the ui/app_list/ code is cpplint clean.""" |
24 black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDE | |
16 sources = lambda x: input_api.FilterSourceFile( | 25 sources = lambda x: input_api.FilterSourceFile( |
17 x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = None) | 26 x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = black_list) |
18 return input_api.canned_checks.CheckChangeLintsClean( | 27 return input_api.canned_checks.CheckChangeLintsClean( |
19 input_api, output_api, sources) | 28 input_api, output_api, sources) |
20 | 29 |
21 def CheckChangeOnUpload(input_api, output_api): | 30 def CheckChangeOnUpload(input_api, output_api): |
22 results = [] | 31 results = [] |
23 results += CheckChangeLintsClean(input_api, output_api) | 32 results += CheckChangeLintsClean(input_api, output_api) |
24 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | 33 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) |
25 return results | 34 return results |
OLD | NEW |