summaryrefslogtreecommitdiffstats
path: root/ui/app_list/PRESUBMIT.py
diff options
context:
space:
mode:
authorhendrikw <hendrikw@chromium.org>2014-11-27 16:56:54 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-28 00:57:14 +0000
commitdf64f7ef9eb6e010fbd109d288d88a9fef49317e (patch)
tree2a8961578a54469835cda7640325cf4942ae1c5e /ui/app_list/PRESUBMIT.py
parent4a280c7c6aa34765d6ae22c8541e8f239bbd65bc (diff)
downloadchromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.zip
chromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.tar.gz
chromium_src-df64f7ef9eb6e010fbd109d288d88a9fef49317e.tar.bz2
ui:app_list Presubmit fix
The presubmit wasn't working on app_list because the regular expression was looking for files in a cc/ dir. Also swept app_list folder for any presubmit errors Review URL: https://codereview.chromium.org/730743002 Cr-Commit-Position: refs/heads/master@{#306038}
Diffstat (limited to 'ui/app_list/PRESUBMIT.py')
-rw-r--r--ui/app_list/PRESUBMIT.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/ui/app_list/PRESUBMIT.py b/ui/app_list/PRESUBMIT.py
index ec96af4..591fad1 100644
--- a/ui/app_list/PRESUBMIT.py
+++ b/ui/app_list/PRESUBMIT.py
@@ -7,25 +7,16 @@
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
-
-CC_SOURCE_FILES=(r'^cc/.*\.(cc|h)$',)
+INCLUDE_CPP_FILES_ONLY = (
+ r'.*\.cc$', r'.*\.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=CC_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.')]
+ """Makes sure that the ui/app_list/ code is cpplint clean."""
+ sources = lambda x: input_api.FilterSourceFile(
+ x, white_list = INCLUDE_CPP_FILES_ONLY, black_list = None)
+ return input_api.canned_checks.CheckChangeLintsClean(
+ input_api, output_api, sources)
def CheckChangeOnUpload(input_api, output_api):
results = []