Chromium Code Reviews| Index: tools/metrics/actions/PRESUBMIT.py |
| diff --git a/tools/metrics/histograms/PRESUBMIT.py b/tools/metrics/actions/PRESUBMIT.py |
| similarity index 59% |
| copy from tools/metrics/histograms/PRESUBMIT.py |
| copy to tools/metrics/actions/PRESUBMIT.py |
| index a4b4ee74b0324673696dccdbe274837ef5280294..7ac4d0879cb86110f173fcbd4c6b0fbdc192647f 100644 |
| --- a/tools/metrics/histograms/PRESUBMIT.py |
| +++ b/tools/metrics/actions/PRESUBMIT.py |
| @@ -2,32 +2,26 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| -""" |
| +"""Presubmit script for actions.xml. |
| + |
| See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| for more details on the presubmit API built into gcl. |
| """ |
| def CheckChange(input_api, output_api): |
| - """Checks that histograms.xml is pretty-printed and well-formatted.""" |
| + """Checks that actions.xml is up to date and pretty-printed.""" |
|
Ilya Sherman
2014/02/22 07:07:37
This PRESUBMIT script only checks that actions.xml
Alexei Svitkine (slow)
2014/02/24 18:32:35
I agree that it's a valid point and it would be go
Ilya Sherman
2014/02/24 18:48:06
For histograms.xml, we don't have any automated sc
|
| for f in input_api.AffectedTextFiles(): |
| p = f.AbsoluteLocalPath() |
| - if (input_api.basename(p) == 'histograms.xml' |
| + 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( |
| - ['python', 'pretty_print.py', '--presubmit'], cwd=cwd) |
| - if exit_code != 0: |
| - return [output_api.PresubmitError( |
| - 'histograms.xml is not formatted correctly; run pretty_print.py ' |
| - 'to fix')] |
| - |
| - exit_code = input_api.subprocess.call( |
| - ['python', 'validate_format.py'], cwd=cwd) |
| + ['python', 'extract_actions.py', '--presubmit'], cwd=cwd) |
| if exit_code != 0: |
| return [output_api.PresubmitError( |
| - 'histograms.xml is not well formatted; run validate_format.py ' |
| - 'and fix the reported errors')] |
| + 'actions.xml is not up to date or is not formatted correctly; ' |
| + 'run extract_actions.py to fix')] |
|
Ilya Sherman
2014/02/22 07:07:37
Please separate out the cases of not up-to-date vs
yao
2014/02/24 19:16:23
It's not trivial to differentiate between 'not up
|
| return [] |