Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: components/sync_sessions/PRESUBMIT.py

Issue 2680413002: Turn on clang format as an upload step for all the repo. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Presubmit script for sync_sessions component. 5 """Presubmit script for sync_sessions component.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
11 import re 11 import re
12 12
13 SYNC_SESSIONS_SOURCE_FILES = (r'^components[\\/]sync_sessions[\\/].*\.(cc|h)$',) 13 SYNC_SESSIONS_SOURCE_FILES = (r'^components[\\/]sync_sessions[\\/].*\.(cc|h)$',)
14 14
15 # The wrapper around lint that is called below disables a set of filters if the 15 # The wrapper around lint that is called below disables a set of filters if the
16 # passed filter evaluates to false. Pass a junk filter to avoid this behavior. 16 # passed filter evaluates to false. Pass a junk filter to avoid this behavior.
17 LINT_FILTERS = ['+fake/filter'] 17 LINT_FILTERS = ['+fake/filter']
18 18
19 def CheckChangeLintsClean(input_api, output_api): 19 def CheckChangeLintsClean(input_api, output_api):
20 source_filter = lambda x: input_api.FilterSourceFile( 20 source_filter = lambda x: input_api.FilterSourceFile(
21 x, white_list=SYNC_SESSIONS_SOURCE_FILES, black_list=None) 21 x, white_list=SYNC_SESSIONS_SOURCE_FILES, black_list=None)
22 return input_api.canned_checks.CheckChangeLintsClean( 22 return input_api.canned_checks.CheckChangeLintsClean(
23 input_api, output_api, source_filter, lint_filters=LINT_FILTERS, 23 input_api, output_api, source_filter, lint_filters=LINT_FILTERS,
24 verbose_level=1) 24 verbose_level=1)
25 25
26 def CheckChanges(input_api, output_api): 26 def CheckChanges(input_api, output_api):
27 results = [] 27 results = []
28 results += CheckChangeLintsClean(input_api, output_api) 28 results += CheckChangeLintsClean(input_api, output_api)
29 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
30 return results 29 return results
31 30
32 def CheckChangeOnUpload(input_api, output_api): 31 def CheckChangeOnUpload(input_api, output_api):
33 return CheckChanges(input_api, output_api) 32 return CheckChanges(input_api, output_api)
34 33
35 def CheckChangeOnCommit(input_api, output_api): 34 def CheckChangeOnCommit(input_api, output_api):
36 return CheckChanges(input_api, output_api) 35 return CheckChanges(input_api, output_api)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698