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

Side by Side Diff: third_party/PRESUBMIT.py

Issue 1454303002: Don't flag third_party/boringssl as needing README.chromium changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 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 ANDROID_WHITELISTED_LICENSES = [ 5 ANDROID_WHITELISTED_LICENSES = [
6 'A(pple )?PSL 2(\.0)?', 6 'A(pple )?PSL 2(\.0)?',
7 'Apache( Version)? 2(\.0)?', 7 'Apache( Version)? 2(\.0)?',
8 '(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?', 8 '(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?',
9 'L?GPL ?v?2(\.[01])?( or later)?', 9 'L?GPL ?v?2(\.[01])?( or later)?',
10 'MIT(/X11)?(-like)?', 10 'MIT(/X11)?(-like)?',
(...skipping 15 matching lines...) Expand all
26 has_compatible_license = False 26 has_compatible_license = False
27 for token in tokens: 27 for token in tokens:
28 if input_api.re.match(regex, token, input_api.re.IGNORECASE): 28 if input_api.re.match(regex, token, input_api.re.IGNORECASE):
29 has_compatible_license = True 29 has_compatible_license = True
30 break 30 break
31 return has_compatible_license 31 return has_compatible_license
32 32
33 def _CheckThirdPartyReadmesUpdated(input_api, output_api): 33 def _CheckThirdPartyReadmesUpdated(input_api, output_api):
34 """ 34 """
35 Checks to make sure that README.chromium files are properly updated 35 Checks to make sure that README.chromium files are properly updated
36 when dependancies in third_party are modified. 36 when dependencies in third_party are modified.
37 """ 37 """
38 readmes = [] 38 readmes = []
39 files = [] 39 files = []
40 errors = [] 40 errors = []
41 for f in input_api.AffectedFiles(): 41 for f in input_api.AffectedFiles():
42 local_path = f.LocalPath() 42 local_path = f.LocalPath()
43 if input_api.os_path.dirname(local_path) == 'third_party': 43 if input_api.os_path.dirname(local_path) == 'third_party':
44 continue 44 continue
45 if (local_path.startswith('third_party' + input_api.os_path.sep) and 45 if (local_path.startswith('third_party' + input_api.os_path.sep) and
46 not local_path.startswith('third_party' + input_api.os_path.sep + 46 not local_path.startswith('third_party' + input_api.os_path.sep +
47 'WebKit' + input_api.os_path.sep)): 47 'WebKit' + input_api.os_path.sep) and
48 not local_path.startswith('third_party' + input_api.os_path.sep +
49 'boringssl' + input_api.os_path.sep)):
48 files.append(f) 50 files.append(f)
49 if local_path.endswith("README.chromium"): 51 if local_path.endswith("README.chromium"):
50 readmes.append(f) 52 readmes.append(f)
51 if files and not readmes: 53 if files and not readmes:
52 errors.append(output_api.PresubmitPromptWarning( 54 errors.append(output_api.PresubmitPromptWarning(
53 'When updating or adding third party code the appropriate\n' 55 'When updating or adding third party code the appropriate\n'
54 '\'README.chromium\' file should also be updated with the correct\n' 56 '\'README.chromium\' file should also be updated with the correct\n'
55 'version and package information.', files)) 57 'version and package information.', files))
56 if not readmes: 58 if not readmes:
57 return errors 59 return errors
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if 'D' not in f.Action(): 128 if 'D' not in f.Action():
127 errors.append(output_api.PresubmitError( 129 errors.append(output_api.PresubmitError(
128 'Third party README should only be removed when the whole\n' 130 'Third party README should only be removed when the whole\n'
129 'directory is being removed.\n', [f, affected_file])) 131 'directory is being removed.\n', [f, affected_file]))
130 132
131 133
132 def CheckChangeOnUpload(input_api, output_api): 134 def CheckChangeOnUpload(input_api, output_api):
133 results = [] 135 results = []
134 results.extend(_CheckThirdPartyReadmesUpdated(input_api, output_api)) 136 results.extend(_CheckThirdPartyReadmesUpdated(input_api, output_api))
135 return results 137 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