Auto merge of #7428 - Wafflespeanut:tidy, r=Ms2ger

tidy will now show its expectation of uses!

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)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7428)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-08-28 03:35:53 -06:00
commit 18de1f2357

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 = []