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 |
11 INCLUDE_CPP_FILES_ONLY = ( | 11 INCLUDE_CPP_FILES_ONLY = ( |
12 r'.*\.(cc|h)$', | 12 r'.*\.(cc|h)$', |
13 ) | 13 ) |
14 | 14 |
15 def CheckChangeLintsClean(input_api, output_api): | 15 def CheckChangeLintsClean(input_api, output_api): |
16 """Makes sure that the ui/app_list/ code is cpplint clean.""" | 16 """Makes sure that the ui/app_list/ code is cpplint clean.""" |
17 black_list = input_api.DEFAULT_BLACK_LIST | 17 black_list = input_api.DEFAULT_BLACK_LIST |
18 sources = lambda x: input_api.FilterSourceFile( | 18 sources = lambda x: input_api.FilterSourceFile( |
19 x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = black_list) | 19 x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = black_list) |
20 return input_api.canned_checks.CheckChangeLintsClean( | 20 return input_api.canned_checks.CheckChangeLintsClean( |
21 input_api, output_api, sources, lint_filters=[], verbose_level=1) | 21 input_api, output_api, sources, lint_filters=[], verbose_level=1) |
22 | 22 |
23 def CheckChangeOnUpload(input_api, output_api): | 23 def CheckChangeOnUpload(input_api, output_api): |
24 results = [] | 24 results = [] |
25 results += CheckChangeLintsClean(input_api, output_api) | 25 results += CheckChangeLintsClean(input_api, output_api) |
26 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | |
27 return results | 26 return results |
OLD | NEW |