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

Unified Diff: build/ios/PRESUBMIT.py

Issue 168643003: Add context to "file must be sorted" error message in ios/PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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: build/ios/PRESUBMIT.py
diff --git a/build/ios/PRESUBMIT.py b/build/ios/PRESUBMIT.py
index 7f3dacd1d74f9c8a77a9b9833ff3fdf6e2b52f9f..a0d32f8b9e1cb89d0616fc483ee1c47617043a6f 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):
« 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