parameters: (input_api, output_api)
return_statement: return [output_api.PresubmitError(r) for r in results]
docstring: Check that bug entries are well-formed in commit message.
docstring_summary: Check that bug entries are well-formed in commit message.
docstring_tokens: Check that bug entries are well - formed in commit message .
function: def _CheckCommitMessageBugEntry(input_api, output_api):
    """Check that bug entries are well-formed in commit message."""
    bogus_bug_msg = (
        'Bogus BUG entry: %s. Please specify the issue tracker prefix and the '
        'issue number, separated by a colon, e.g. v8:123 or chromium:12345.')
    results = []
    for bug in (input_api.change.BUG or '').split(','):
      bug = bug.strip()
      if 'none'.startswith(bug.lower()):
        continue
      if ':' not in bug:
        try:
          if int(bug) > 100000:
            # Rough indicator for current chromium bugs.
            prefix_guess = 'chromium'
          else:
            prefix_guess = 'v8'
          results.append('BUG entry requires issue tracker prefix, e.g. %s:%s' %
                         (prefix_guess, bug))
        except ValueError:
          results.append(bogus_bug_msg % bug)
      elif not re.match(r'\w+:\d+', bug):
        results.append(bogus_bug_msg % bug)
    return [output_api.PresubmitError(r) for r in results]
function_tokens: def _CheckCommitMessageBugEntry ( input_api , output_api ) : bogus_bug_msg = ( 'Bogus BUG entry: %s. Please specify the issue tracker prefix and the ' 'issue number, separated by a colon, e.g. v8:123 or chromium:12345.' ) results = [ ] for bug in ( input_api . change . BUG or '' ) . split ( ',' ) : bug = bug . strip ( ) if 'none' . startswith ( bug . lower ( ) ) : continue if ':' not in bug : try : if int ( bug ) > 100000 : # Rough indicator for current chromium bugs. prefix_guess = 'chromium' else : prefix_guess = 'v8' results . append ( 'BUG entry requires issue tracker prefix, e.g. %s:%s' % ( prefix_guess , bug ) ) except ValueError : results . append ( bogus_bug_msg % bug ) elif not re . match ( r'\w+:\d+' , bug ) : results . append ( bogus_bug_msg % bug ) return [ output_api . PresubmitError ( r ) for r in results ]