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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 'CL\'s description')) | 385 'CL\'s description')) |
386 if not re.search( | 386 if not re.search( |
387 r'^NOTRY=true$', new_description, re.M | re.I): | 387 r'^NOTRY=true$', new_description, re.M | re.I): |
388 new_description += "\nNOTRY=true" | 388 new_description += "\nNOTRY=true" |
389 results.append( | 389 results.append( |
390 output_api.PresubmitNotifyResult( | 390 output_api.PresubmitNotifyResult( |
391 'Trybots do not yet work for non-master branches. ' | 391 'Trybots do not yet work for non-master branches. ' |
392 'Automatically added \'NOTRY=true\' to the CL\'s description')) | 392 'Automatically added \'NOTRY=true\' to the CL\'s description')) |
393 | 393 |
394 # Read and process the HASHTAGS file. | 394 # Read and process the HASHTAGS file. |
395 with open('HASHTAGS', 'rb') as hashtags_csv: | 395 hashtags_fullpath = os.path.join(change._local_root, 'HASHTAGS') |
| 396 with open(hashtags_fullpath, 'rb') as hashtags_csv: |
396 hashtags_reader = csv.reader(hashtags_csv, delimiter=',') | 397 hashtags_reader = csv.reader(hashtags_csv, delimiter=',') |
397 for row in hashtags_reader: | 398 for row in hashtags_reader: |
398 if not row or row[0].startswith('#'): | 399 if not row or row[0].startswith('#'): |
399 # Ignore empty lines and comments | 400 # Ignore empty lines and comments |
400 continue | 401 continue |
401 hashtag = row[0] | 402 hashtag = row[0] |
402 # Search for the hashtag in the description. | 403 # Search for the hashtag in the description. |
403 if re.search('#%s' % hashtag, new_description, re.M | re.I): | 404 if re.search('#%s' % hashtag, new_description, re.M | re.I): |
404 for mapped_text in row[1:]: | 405 for mapped_text in row[1:]: |
405 # Special case handling for CQ_KEYWORDS_THAT_NEED_APPENDING. | 406 # Special case handling for CQ_KEYWORDS_THAT_NEED_APPENDING. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 state and an error if it is in 'Closed' state. | 462 state and an error if it is in 'Closed' state. |
462 """ | 463 """ |
463 results = [] | 464 results = [] |
464 results.extend(_CommonChecks(input_api, output_api)) | 465 results.extend(_CommonChecks(input_api, output_api)) |
465 results.extend( | 466 results.extend( |
466 _CheckTreeStatus(input_api, output_api, json_url=( | 467 _CheckTreeStatus(input_api, output_api, json_url=( |
467 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) | 468 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) |
468 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) | 469 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) |
469 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) | 470 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) |
470 return results | 471 return results |
OLD | NEW |