diff options
author | tnagel@chromium.org <tnagel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-17 12:19:37 +0000 |
---|---|---|
committer | tnagel@chromium.org <tnagel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-17 12:19:37 +0000 |
commit | 1e1e75da1581616c8362897cd3b6233f0bb271ec (patch) | |
tree | 7659610ce528d60c569e91db28c2f9c7dd79088c /build/ios | |
parent | db6caeb00680984368df410ed6ac491c9f7b7d37 (diff) | |
download | chromium_src-1e1e75da1581616c8362897cd3b6233f0bb271ec.zip chromium_src-1e1e75da1581616c8362897cd3b6233f0bb271ec.tar.gz chromium_src-1e1e75da1581616c8362897cd3b6233f0bb271ec.tar.bz2 |
Add context to "file must be sorted" error message in ios/PRESUBMIT.py
BUG=none
Review URL: https://codereview.chromium.org/168643003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/ios')
-rw-r--r-- | build/ios/PRESUBMIT.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/build/ios/PRESUBMIT.py b/build/ios/PRESUBMIT.py index 7f3dacd..a0d32f8 100644 --- a/build/ios/PRESUBMIT.py +++ b/build/ios/PRESUBMIT.py @@ -16,10 +16,13 @@ def _CheckWhitelistSorted(input_api, output_api): for path in input_api.LocalPaths(): if WHITELIST_FILE == path: lines = open(os.path.join('../..', WHITELIST_FILE)).readlines() - sorted = all(lines[i] <= lines[i + 1] for i in xrange(len(lines) - 1)) - if not sorted: + i = 0 + while i < len(lines) - 1 and lines[i] <= lines[i + 1]: + i += 1 + if i < len(lines) - 1: return [output_api.PresubmitError( - 'The file ' + WHITELIST_FILE + ' must be sorted.')] + 'The file ' + WHITELIST_FILE + ' must be sorted. ' + + 'First offending line: #' + str(i + 2))] return [] def _CommonChecks(input_api, output_api): |