Fix cert DB usage in PolicyCertVerifier test.
[chromium-blink-merge.git] / ui / app_list / PRESUBMIT.py
blobec96af4480ac74a4889acd1d676587fe4f23c4d5
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.
5 """Presubmit script for app_list.
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 """
11 CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',)
13 def CheckChangeLintsClean(input_api, output_api):
14 input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
15 source_filter = lambda x: input_api.FilterSourceFile(
16 x, white_list=CC_SOURCE_FILES, black_list=None)
17 files = [f.AbsoluteLocalPath() for f in
18 input_api.AffectedSourceFiles(source_filter)]
19 level = 1 # strict, but just warn
21 for file_name in files:
22 input_api.cpplint.ProcessFile(file_name, level)
24 if not input_api.cpplint._cpplint_state.error_count:
25 return []
27 return [output_api.PresubmitPromptWarning(
28 'Changelist failed cpplint.py check.')]
30 def CheckChangeOnUpload(input_api, output_api):
31 results = []
32 results += CheckChangeLintsClean(input_api, output_api)
33 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
34 return results