[email protected] | ee99b70 | 2014-02-18 03:54:11 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Presubmit script for app_list. |
| 6 | |
| 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details about the presubmit API built into depot_tools. |
| 9 | """ |
tfarina | 2a83d9f | 2014-12-12 02:32:51 | [diff] [blame] | 10 | |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame] | 11 | INCLUDE_CPP_FILES_ONLY = ( |
tfarina | 2a83d9f | 2014-12-12 02:32:51 | [diff] [blame] | 12 | r'.*\.(cc|h)$', |
| 13 | ) |
| 14 | |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 15 | def CheckChangeLintsClean(input_api, output_api): |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame] | 16 | """Makes sure that the ui/app_list/ code is cpplint clean.""" |
tapted | 85b4387b | 2016-07-08 00:29:56 | [diff] [blame] | 17 | black_list = input_api.DEFAULT_BLACK_LIST |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame] | 18 | sources = lambda x: input_api.FilterSourceFile( |
tfarina | 2a83d9f | 2014-12-12 02:32:51 | [diff] [blame] | 19 | x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = black_list) |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame] | 20 | return input_api.canned_checks.CheckChangeLintsClean( |
tfarina | 5d9e9091 | 2015-03-02 21:01:34 | [diff] [blame] | 21 | input_api, output_api, sources, lint_filters=[], verbose_level=1) |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 22 | |
[email protected] | ee99b70 | 2014-02-18 03:54:11 | [diff] [blame] | 23 | def CheckChangeOnUpload(input_api, output_api): |
| 24 | results = [] |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 25 | results += CheckChangeLintsClean(input_api, output_api) |
[email protected] | ee99b70 | 2014-02-18 03:54:11 | [diff] [blame] | 26 | return results |