Commit f3cac415 authored by Alexei Svitkine's avatar Alexei Svitkine Committed by Commit Bot

Integrate metrics XML file pretty print into git cl format.

Depends on: https://codereview.chromium.org/2674283002/

BUG=679514

Change-Id: I61611fc19724028bb8cdefefc50b4d5d3bb77a46
Reviewed-on: https://chromium-review.googlesource.com/437919
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
parent 21fb824e
......@@ -5176,6 +5176,22 @@ def CMDformat(parser, args):
DieWithError("gn format failed on " + gn_diff_file +
"\nTry running 'gn format' on this file manually.")
metrics_xml_files = [
'tools/metrics/actions/actions.xml',
'tools/metrics/histograms/histograms.xml',
'tools/metrics/rappor/rappor.xml']
for xml_file in metrics_xml_files:
if xml_file in diff_files:
tool_dir = top_dir + '/' + os.path.dirname(xml_file)
cmd = [tool_dir + '/pretty_print.py', '--non-interactive']
if opts.dry_run or opts.diff:
cmd.append('--diff')
stdout = RunCommand(cmd, cwd=top_dir)
if opts.diff:
sys.stdout.write(stdout)
if opts.dry_run and stdout:
return_value = 2 # Not formatted.
return return_value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment