OLD | NEW |
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 lgtm_from_owner = False | 248 lgtm_from_owner = False |
249 issue = input_api.change.issue | 249 issue = input_api.change.issue |
250 if issue and input_api.rietveld: | 250 if issue and input_api.rietveld: |
251 issue_properties = input_api.rietveld.get_issue_properties( | 251 issue_properties = input_api.rietveld.get_issue_properties( |
252 issue=int(issue), messages=True) | 252 issue=int(issue), messages=True) |
253 if re.match(REVERT_CL_SUBJECT_PREFIX, issue_properties['subject'], re.I): | 253 if re.match(REVERT_CL_SUBJECT_PREFIX, issue_properties['subject'], re.I): |
254 # It is a revert CL, ignore the public api owners check. | 254 # It is a revert CL, ignore the public api owners check. |
255 return results | 255 return results |
256 | 256 |
| 257 if re.search(r'^COMMIT=false$', issue_properties['description'], re.M): |
| 258 # Ignore public api owners check for COMMIT=false CLs since they are not |
| 259 # going to be committed. |
| 260 return results |
| 261 |
257 match = re.search(r'^TBR=(.*)$', issue_properties['description'], re.M) | 262 match = re.search(r'^TBR=(.*)$', issue_properties['description'], re.M) |
258 if match: | 263 if match: |
259 tbr_entries = match.group(1).strip().split(',') | 264 tbr_entries = match.group(1).strip().split(',') |
260 for owner in PUBLIC_API_OWNERS: | 265 for owner in PUBLIC_API_OWNERS: |
261 if owner in tbr_entries or owner.split('@')[0] in tbr_entries: | 266 if owner in tbr_entries or owner.split('@')[0] in tbr_entries: |
262 # If an owner is specified in the TBR= line then ignore the public | 267 # If an owner is specified in the TBR= line then ignore the public |
263 # api owners check. | 268 # api owners check. |
264 return results | 269 return results |
265 | 270 |
266 if issue_properties['owner_email'] in PUBLIC_API_OWNERS: | 271 if issue_properties['owner_email'] in PUBLIC_API_OWNERS: |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 state and an error if it is in 'Closed' state. | 380 state and an error if it is in 'Closed' state. |
376 """ | 381 """ |
377 results = [] | 382 results = [] |
378 results.extend(_CommonChecks(input_api, output_api)) | 383 results.extend(_CommonChecks(input_api, output_api)) |
379 results.extend( | 384 results.extend( |
380 _CheckTreeStatus(input_api, output_api, json_url=( | 385 _CheckTreeStatus(input_api, output_api, json_url=( |
381 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) | 386 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) |
382 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) | 387 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) |
383 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) | 388 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) |
384 return results | 389 return results |
OLD | NEW |