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

Side by Side Diff: PRESUBMIT.py

Issue 511503002: PRESUBMIT should only check owners for the top level include directory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove testing code Created 6 years, 3 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
« 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) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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 5
6 """Top-level presubmit script for Skia. 6 """Top-level presubmit script for Skia.
7 7
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
9 for more details about the presubmit API built into gcl. 9 for more details about the presubmit API built into gcl.
10 """ 10 """
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 183
184 def _CheckLGTMsForPublicAPI(input_api, output_api): 184 def _CheckLGTMsForPublicAPI(input_api, output_api):
185 """Check LGTMs for public API changes. 185 """Check LGTMs for public API changes.
186 186
187 For public API files make sure there is an LGTM from the list of owners in 187 For public API files make sure there is an LGTM from the list of owners in
188 PUBLIC_API_OWNERS. 188 PUBLIC_API_OWNERS.
189 """ 189 """
190 results = [] 190 results = []
191 requires_owner_check = False 191 requires_owner_check = False
192 for affected_svn_file in input_api.AffectedFiles(): 192 for affected_git_file in input_api.AffectedFiles():
borenet 2014/08/26 18:50:06 Why not just affected_file?
rmistry 2014/08/26 18:59:39 Not sure, it felt good to replace svn with git. Do
193 affected_file_path = affected_svn_file.AbsoluteLocalPath() 193 affected_file_path = affected_git_file.LocalPath()
194 file_path, file_ext = os.path.splitext(affected_file_path) 194 file_path, file_ext = os.path.splitext(affected_file_path)
195 # We only care about files that end in .h and are under the include dir. 195 # We only care about files that end in .h and are under the top-level
196 if file_ext == '.h' and 'include' in file_path.split(os.path.sep): 196 # include dir.
197 if file_ext == '.h' and 'include' == file_path.split(os.path.sep)[0]:
borenet 2014/08/26 18:50:05 os.path.dirname?
rmistry 2014/08/26 18:59:39 That will not work because for paths like 'include
197 requires_owner_check = True 198 requires_owner_check = True
198 199
199 if not requires_owner_check: 200 if not requires_owner_check:
200 return results 201 return results
201 202
202 lgtm_from_owner = False 203 lgtm_from_owner = False
203 issue = input_api.change.issue 204 issue = input_api.change.issue
204 if issue and input_api.rietveld: 205 if issue and input_api.rietveld:
205 issue_properties = input_api.rietveld.get_issue_properties( 206 issue_properties = input_api.rietveld.get_issue_properties(
206 issue=int(issue), messages=True) 207 issue=int(issue), messages=True)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 state and an error if it is in 'Closed' state. 249 state and an error if it is in 'Closed' state.
249 """ 250 """
250 results = [] 251 results = []
251 results.extend(_CommonChecks(input_api, output_api)) 252 results.extend(_CommonChecks(input_api, output_api))
252 results.extend( 253 results.extend(
253 _CheckTreeStatus(input_api, output_api, json_url=( 254 _CheckTreeStatus(input_api, output_api, json_url=(
254 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) 255 SKIA_TREE_STATUS_URL + '/banner-status?format=json')))
255 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) 256 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api))
256 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) 257 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api))
257 return results 258 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