Roll leveldb to r78 / 1.15.
[chromium-blink-merge.git] / webkit / renderer / compositor_bindings / PRESUBMIT.py
blob4c2c1f987411e890f65cd3c5cc72ef5eba752c7f
1 # Copyright (c) 2013 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 """
6 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
7 details on the presubmit API built into gcl.
8 """
10 SOURCE_FILES = (r'^.*\.(cc|h)$')
12 def CheckChangeLintsClean(input_api, output_api):
13 input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
14 source_filter = lambda x: input_api.FilterSourceFile(
15 x, white_list=SOURCE_FILES, black_list=None)
16 files = [f.AbsoluteLocalPath() for f in
17 input_api.AffectedSourceFiles(source_filter)]
18 level = 1 # strict, but just warn
20 for file_name in files:
21 input_api.cpplint.ProcessFile(file_name, level)
23 if not input_api.cpplint._cpplint_state.error_count:
24 return []
26 return [output_api.PresubmitPromptWarning(
27 'Changelist failed cpplint.py check.')]
30 def CheckChangeOnUpload(input_api, output_api):
31 results = []
32 results += CheckChangeLintsClean(input_api, output_api)
33 return results