[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 | """ |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame^] | 10 | INCLUDE_CPP_FILES_ONLY = ( |
| 11 | r'.*\.cc$', r'.*\.h$' |
| 12 | ) |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 13 | |
| 14 | def CheckChangeLintsClean(input_api, output_api): |
hendrikw | df64f7e | 2014-11-28 00:56:54 | [diff] [blame^] | 15 | """Makes sure that the ui/app_list/ code is cpplint clean.""" |
| 16 | sources = lambda x: input_api.FilterSourceFile( |
| 17 | x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = None) |
| 18 | return input_api.canned_checks.CheckChangeLintsClean( |
| 19 | input_api, output_api, sources) |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 20 | |
[email protected] | ee99b70 | 2014-02-18 03:54:11 | [diff] [blame] | 21 | def CheckChangeOnUpload(input_api, output_api): |
| 22 | results = [] |
[email protected] | 5d72323 | 2014-03-04 22:19:46 | [diff] [blame] | 23 | results += CheckChangeLintsClean(input_api, output_api) |
[email protected] | ee99b70 | 2014-02-18 03:54:11 | [diff] [blame] | 24 | results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) |
| 25 | return results |