Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2014)

Unified Diff: tools/metrics/histograms/PRESUBMIT.py

Issue 2792723002: Remove pretty_print step from histograms presubmit, git cl format handles this. (Closed)
Patch Set: Restore validate_format. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/metrics/histograms/PRESUBMIT.py
diff --git a/tools/metrics/histograms/PRESUBMIT.py b/tools/metrics/histograms/PRESUBMIT.py
index 7d9e9ff66bb2fbc421f727e7dd893e751f4e56ac..24b86aa199e32c15673942c6e24dc295467faf30 100644
--- a/tools/metrics/histograms/PRESUBMIT.py
+++ b/tools/metrics/histograms/PRESUBMIT.py
@@ -12,22 +12,18 @@ def CheckChange(input_api, output_api):
"""Checks that histograms.xml is pretty-printed and well-formatted."""
for f in input_api.AffectedTextFiles():
p = f.AbsoluteLocalPath()
- if (input_api.basename(p) == 'histograms.xml'
- and input_api.os_path.dirname(p) == input_api.PresubmitLocalPath()):
- cwd = input_api.os_path.dirname(p)
- exit_code = input_api.subprocess.call(
- ['python', 'pretty_print.py', '--presubmit'], cwd=cwd)
- if exit_code != 0:
- return [output_api.PresubmitError(
- 'histograms.xml is not formatted correctly; run %s/pretty_print.py '
- 'to fix' % input_api.PresubmitLocalPath())]
-
- exit_code = input_api.subprocess.call(
- ['python', 'validate_format.py'], cwd=cwd)
- if exit_code != 0:
- return [output_api.PresubmitError(
- 'histograms.xml is not well formatted; run %s/validate_format.py '
- 'and fix the reported errors' % input_api.PresubmitLocalPath())]
+ if input_api.basename(p) != 'histograms.xml':
+ continue
+ cwd = input_api.os_path.dirname(p)
+ if cwd != input_api.PresubmitLocalPath():
+ continue
+
+ exit_code = input_api.subprocess.call(
+ ['python', 'validate_format.py'], cwd=cwd)
+ if exit_code != 0:
+ return [output_api.PresubmitError(
+ 'histograms.xml is not well formatted; run %s/validate_format.py '
+ 'and fix the reported errors' % cwd)]
return []
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698