tools/android/checkxmlstyle/checkxmlstyle.py
def _CheckNewTextAppearance(input_api, output_api):
  """Checks whether a new text appearance style is defined."""
  errors = []
  for f in IncludedFiles(input_api):
    for line_number, line in f.ChangedContents():
      if '<style name="TextAppearance.' in line:
        errors.append(
            '  %s:%d\n    \t%s' % (f.LocalPath(), line_number, line.strip()))
  if errors:
    return [
        output_api.PresubmitPromptWarning(
            '''
  New Text Appearance in styles.xml Check failed:
    Your new code added, edited or removed a text appearance style.
    If you are removing or editing an existing text appearance style, or your
    new text appearance style is approved by UX, please bypass this check.

    Otherwise, please contact arminaforoughi@chromium.org for UX approval, and
    src/chrome/android/java/res/OWNERS for questions.
    See https://crbug.com/775198 for more information.
  ''', errors)
    ]
  return []
Checks whether a new text appearance style is defined.
Checks whether a new text appearance style is defined.
Checks whether a new text appearance style is defined .
def _CheckNewTextAppearance(input_api, output_api):
  errors = []
  for f in IncludedFiles(input_api):
    for line_number, line in f.ChangedContents():
      if '<style name="TextAppearance.' in line:
        errors.append(
            '  %s:%d\n    \t%s' % (f.LocalPath(), line_number, line.strip()))
  if errors:
    return [
        output_api.PresubmitPromptWarning(
            '''
  New Text Appearance in styles.xml Check failed:
    Your new code added, edited or removed a text appearance style.
    If you are removing or editing an existing text appearance style, or your
    new text appearance style is approved by UX, please bypass this check.
    Otherwise, please contact arminaforoughi@chromium.org for UX approval, and
    src/chrome/android/java/res/OWNERS for questions.
    See https://crbug.com/775198 for more information.
  ''', errors)
    ]
  return []
def _CheckNewTextAppearance ( input_api , output_api ) : errors = [ ] for f in IncludedFiles ( input_api ) : for line_number , line in f . ChangedContents ( ) : if '<style name="TextAppearance.' in line : errors . append ( '  %s:%d\n    \t%s' % ( f . LocalPath ( ) , line_number , line . strip ( ) ) ) if errors : return [ output_api . PresubmitPromptWarning ( '''
  New Text Appearance in styles.xml Check failed:
    Your new code added, edited or removed a text appearance style.
    If you are removing or editing an existing text appearance style, or your
    new text appearance style is approved by UX, please bypass this check.

    Otherwise, please contact arminaforoughi@chromium.org for UX approval, and
    src/chrome/android/java/res/OWNERS for questions.
    See https://crbug.com/775198 for more information.
  ''' , errors ) ] return [ ]
Checks whether a new text appearance style is defined.
Checks whether a new text appearance style is defined .
"""Checks whether a new text appearance style is defined."""
input_api
output_api