servo: Merge #7428 - tidy will now show its expectation of uses! (from Wafflespeanut:tidy); r=Ms2ger

closes #7427

(pretty errors "inherited" from rust's type checker) :P

![screenshot](https://cloud.githubusercontent.com/assets/6691262/9543298/8cabfdaa-4d95-11e5-9101-14e62781e74e.png)

Source-Repo: https://github.com/servo/servo
Source-Revision: 18de1f2357144d86ea83cd0cb66922e8a2157597
This commit is contained in:
Ravi Shankar
2015-08-28 03:35:53 -06:00
parent 58d2d82b26
commit 25e2af55d8

View File

@@ -253,7 +253,10 @@ def check_rust(file_name, contents):
sorted_uses = sorted(uses)
for i in range(len(uses)):
if sorted_uses[i] != uses[i]:
yield (idx + 1 - len(uses) + i, "use statement is not in alphabetical order")
message = "use statement is not in alphabetical order"
expected = "\n\t\033[93mexpected: {}\033[0m".format(sorted_uses[i])
found = "\n\t\033[91mfound: {}\033[0m".format(uses[i])
yield (idx + 1 - len(uses) + i, message + expected + found)
uses = []