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

Side by Side Diff: base/PRESUBMIT.py

Issue 708513002: Allow Objective-C interfaces in //base/ios (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Chromium presubmit script for src/base. 5 """Chromium presubmit script for src/base.
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 on the presubmit API built into gcl. 8 for more details on the presubmit API built into gcl.
9 """ 9 """
10 10
11 def _CheckNoInterfacesInBase(input_api, output_api): 11 def _CheckNoInterfacesInBase(input_api, output_api):
12 """Checks to make sure no files in libbase.a have |@interface|.""" 12 """Checks to make sure no files in libbase.a have |@interface|."""
13 pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE) 13 pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
14 files = [] 14 files = []
15 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): 15 for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
16 if (f.LocalPath().startswith('base/') and 16 if (f.LocalPath().startswith('base/') and
17 not "/ios/" in f.LocalPath() and
17 not "/test/" in f.LocalPath() and 18 not "/test/" in f.LocalPath() and
18 not f.LocalPath().endswith('_unittest.mm') and 19 not f.LocalPath().endswith('_unittest.mm') and
19 not f.LocalPath().endswith('mac/sdk_forward_declarations.h')): 20 not f.LocalPath().endswith('mac/sdk_forward_declarations.h')):
20 contents = input_api.ReadFile(f) 21 contents = input_api.ReadFile(f)
21 if pattern.search(contents): 22 if pattern.search(contents):
22 files.append(f) 23 files.append(f)
23 24
24 if len(files): 25 if len(files):
25 return [ output_api.PresubmitError( 26 return [ output_api.PresubmitError(
26 'Objective-C interfaces or categories are forbidden in libbase. ' + 27 'Objective-C interfaces or categories are forbidden in libbase. ' +
(...skipping 12 matching lines...) Expand all
39 def CheckChangeOnUpload(input_api, output_api): 40 def CheckChangeOnUpload(input_api, output_api):
40 results = [] 41 results = []
41 results.extend(_CommonChecks(input_api, output_api)) 42 results.extend(_CommonChecks(input_api, output_api))
42 return results 43 return results
43 44
44 45
45 def CheckChangeOnCommit(input_api, output_api): 46 def CheckChangeOnCommit(input_api, output_api):
46 results = [] 47 results = []
47 results.extend(_CommonChecks(input_api, output_api)) 48 results.extend(_CommonChecks(input_api, output_api))
48 return results 49 return results
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698