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

Side by Side Diff: PRESUBMIT.py

Issue 1058483002: Find the HASHTAGS file even if you are not at the checkout root (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 8 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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