ios/PRESUBMIT.py
def _CheckNullabilityAnnotations(input_api, output_api):
  """ Checks whether there are nullability annotations in ios code."""
  nullability_regex = input_api.re.compile(NULLABILITY_PATTERN)

  errors = []
  for f in input_api.AffectedFiles():
    for line_num, line in f.ChangedContents():
      if nullability_regex.search(line):
        errors.append('%s:%s' % (f.LocalPath(), line_num))
  if not errors:
    return []

  plural_suffix = '' if len(errors) == 1 else 's'
  error_message = ('Found Nullability annotation%(plural)s. '
      'Prefer DCHECKs in ios code to check for nullness:'
       % {'plural': plural_suffix})

  return [output_api.PresubmitPromptWarning(error_message, items=errors)]
 Checks whether there are nullability annotations in ios code.
Checks whether there are nullability annotations in ios code.
Checks whether there are nullability annotations in ios code .
def _CheckNullabilityAnnotations(input_api, output_api):
  nullability_regex = input_api.re.compile(NULLABILITY_PATTERN)
  errors = []
  for f in input_api.AffectedFiles():
    for line_num, line in f.ChangedContents():
      if nullability_regex.search(line):
        errors.append('%s:%s' % (f.LocalPath(), line_num))
  if not errors:
    return []
  plural_suffix = '' if len(errors) == 1 else 's'
  error_message = ('Found Nullability annotation%(plural)s. '
      'Prefer DCHECKs in ios code to check for nullness:'
       % {'plural': plural_suffix})
  return [output_api.PresubmitPromptWarning(error_message, items=errors)]
def _CheckNullabilityAnnotations ( input_api , output_api ) : nullability_regex = input_api . re . compile ( NULLABILITY_PATTERN ) errors = [ ] for f in input_api . AffectedFiles ( ) : for line_num , line in f . ChangedContents ( ) : if nullability_regex . search ( line ) : errors . append ( '%s:%s' % ( f . LocalPath ( ) , line_num ) ) if not errors : return [ ] plural_suffix = '' if len ( errors ) == 1 else 's' error_message = ( 'Found Nullability annotation%(plural)s. ' 'Prefer DCHECKs in ios code to check for nullness:' % { 'plural' : plural_suffix } ) return [ output_api . PresubmitPromptWarning ( error_message , items = errors ) ]
Checks whether there are nullability annotations in ios code.
Checks whether there are nullability annotations in ios code .
""" Checks whether there are nullability annotations in ios code."""
input_api
output_api