tools/metrics/actions/PRESUBMIT.py
def CheckChange(input_api, output_api):
  """Checks that actions.xml is up to date and pretty-printed."""
  for f in input_api.AffectedTextFiles():
    p = f.AbsoluteLocalPath()
    if (input_api.basename(p) == 'actions.xml'
        and input_api.os_path.dirname(p) == input_api.PresubmitLocalPath()):
      cwd = input_api.os_path.dirname(p)
      exit_code = input_api.subprocess.call(
          [input_api.python_executable, 'extract_actions.py', '--presubmit'],
          cwd=cwd)
      if exit_code != 0:
        return [output_api.PresubmitError(
            'actions.xml is not up to date or is not formatted correctly; '
            'run extract_actions.py to fix')]
  return []
Checks that actions.xml is up to date and pretty-printed.
Checks that actions.xml is up to date and pretty-printed.
Checks that actions . xml is up to date and pretty - printed .
def CheckChange(input_api, output_api):
  for f in input_api.AffectedTextFiles():
    p = f.AbsoluteLocalPath()
    if (input_api.basename(p) == 'actions.xml'
        and input_api.os_path.dirname(p) == input_api.PresubmitLocalPath()):
      cwd = input_api.os_path.dirname(p)
      exit_code = input_api.subprocess.call(
          [input_api.python_executable, 'extract_actions.py', '--presubmit'],
          cwd=cwd)
      if exit_code != 0:
        return [output_api.PresubmitError(
            'actions.xml is not up to date or is not formatted correctly; '
            'run extract_actions.py to fix')]
  return []
def CheckChange ( input_api , output_api ) : for f in input_api . AffectedTextFiles ( ) : p = f . AbsoluteLocalPath ( ) if ( input_api . basename ( p ) == 'actions.xml' and input_api . os_path . dirname ( p ) == input_api . PresubmitLocalPath ( ) ) : cwd = input_api . os_path . dirname ( p ) exit_code = input_api . subprocess . call ( [ input_api . python_executable , 'extract_actions.py' , '--presubmit' ] , cwd = cwd ) if exit_code != 0 : return [ output_api . PresubmitError ( 'actions.xml is not up to date or is not formatted correctly; ' 'run extract_actions.py to fix' ) ] return [ ]
Checks that actions.xml is up to date and pretty-printed.
Checks that actions . xml is up to date and pretty - printed .
"""Checks that actions.xml is up to date and pretty-printed."""
input_api
output_api