tools/metrics/histograms/PRESUBMIT.py
def CheckChange(input_api, output_api):
  """Checks that histograms.xml is pretty-printed and well-formatted."""
  results = []
  cwd = input_api.PresubmitLocalPath()
  xml_changed = False

  # Only for changed files, do corresponding checks if the file is
  # histograms.xml, enums.xml or obsolete_histograms.xml.
  for file_obj in input_api.AffectedTextFiles():
    is_changed = ValidateSingleFile(
        input_api, output_api, file_obj, cwd, results)
    xml_changed = xml_changed or is_changed

  # Run validate_format.py and validate_histograms_index.py, if changed files
  # contain histograms.xml or enums.xml.
  if xml_changed:
    GetValidateHistogramsError(input_api, output_api, cwd, results)

  return results
Checks that histograms.xml is pretty-printed and well-formatted.
Checks that histograms.xml is pretty-printed and well-formatted.
Checks that histograms . xml is pretty - printed and well - formatted .
def CheckChange(input_api, output_api):
  results = []
  cwd = input_api.PresubmitLocalPath()
  xml_changed = False
  for file_obj in input_api.AffectedTextFiles():
    is_changed = ValidateSingleFile(
        input_api, output_api, file_obj, cwd, results)
    xml_changed = xml_changed or is_changed
  if xml_changed:
    GetValidateHistogramsError(input_api, output_api, cwd, results)
  return results
def CheckChange ( input_api , output_api ) : results = [ ] cwd = input_api . PresubmitLocalPath ( ) xml_changed = False for file_obj in input_api . AffectedTextFiles ( ) : is_changed = ValidateSingleFile ( input_api , output_api , file_obj , cwd , results ) xml_changed = xml_changed or is_changed if xml_changed : GetValidateHistogramsError ( input_api , output_api , cwd , results ) return results
Checks that histograms.xml is pretty-printed and well-formatted.
Checks that histograms . xml is pretty - printed and well - formatted .
"""Checks that histograms.xml is pretty-printed and well-formatted.""" # Only for changed files, do corresponding checks if the file is # histograms.xml, enums.xml or obsolete_histograms.xml. # Run validate_format.py and validate_histograms_index.py, if changed files # contain histograms.xml or enums.xml.
input_api
output_api