Commit 16f5cf09 authored by enne@chromium.org's avatar enne@chromium.org

Add cpplint for webkit/compositor_bindings

Clean up the only presubmit error in the compositor bindings and
turn on cpplint warnings to prevent any future regressions.

Also, clean up cc's presubmit to match now that depot_tools has cpplint
in its input_api.

R=danakj@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/13949005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194598 0039d316-1c4b-4281-b951-d872f2087c98
parent af4e286e
...@@ -14,26 +14,17 @@ CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',) ...@@ -14,26 +14,17 @@ CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',)
CC_PERF_TEST =(r'^.*_perftest.*\.(cc|h)$',) CC_PERF_TEST =(r'^.*_perftest.*\.(cc|h)$',)
def CheckChangeLintsClean(input_api, output_api): def CheckChangeLintsClean(input_api, output_api):
import cpplint input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
cpplint._cpplint_state.ResetErrorCounts() # reset global state
source_filter = lambda x: input_api.FilterSourceFile( source_filter = lambda x: input_api.FilterSourceFile(
x, white_list=CC_SOURCE_FILES, black_list=None) x, white_list=CC_SOURCE_FILES, black_list=None)
files = [f.AbsoluteLocalPath() for f in files = [f.AbsoluteLocalPath() for f in
input_api.AffectedSourceFiles(source_filter)] input_api.AffectedSourceFiles(source_filter)]
level = 1 # strict, but just warn level = 1 # strict, but just warn
# Replace <hash_map> and <hash_set> as headers that need to be included
# with "base/hash_tables.h" instead.
cpplint._re_pattern_templates = [
(a,b,'base/hash_tables.h') if (header == '<hash_map>' or
header == '<hash_set>')
else (a,b,header)
for (a,b,header) in cpplint._re_pattern_templates]
for file_name in files: for file_name in files:
cpplint.ProcessFile(file_name, level) input_api.cpplint.ProcessFile(file_name, level)
if not cpplint._cpplint_state.error_count: if not input_api.cpplint._cpplint_state.error_count:
return [] return []
return [output_api.PresubmitPromptWarning( return [output_api.PresubmitPromptWarning(
......
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into gcl.
"""
SOURCE_FILES = (r'^.*\.(cc|h)$')
def CheckChangeLintsClean(input_api, output_api):
input_api.cpplint._cpplint_state.ResetErrorCounts() # reset global state
source_filter = lambda x: input_api.FilterSourceFile(
x, white_list=SOURCE_FILES, black_list=None)
files = [f.AbsoluteLocalPath() for f in
input_api.AffectedSourceFiles(source_filter)]
level = 1 # strict, but just warn
for file_name in files:
input_api.cpplint.ProcessFile(file_name, level)
if not input_api.cpplint._cpplint_state.error_count:
return []
return [output_api.PresubmitPromptWarning(
'Changelist failed cpplint.py check.')]
def CheckChangeOnUpload(input_api, output_api):
results = []
results += CheckChangeLintsClean(input_api, output_api)
return results
...@@ -136,4 +136,4 @@ void WebExternalTextureLayerImpl::DidReleaseMailbox( ...@@ -136,4 +136,4 @@ void WebExternalTextureLayerImpl::DidReleaseMailbox(
client_->mailboxReleased(available_mailbox); client_->mailboxReleased(available_mailbox);
} }
} // namespace webkit } // namespace webkit
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment