Skip to content

Commit

Permalink
Auto merge of #7428 - Wafflespeanut:tidy, r=Ms2ger
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo committed Aug 28, 2015
2 parents 6431e8d + 6ef5c8e commit 18de1f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ def is_associated_type(match, line, index):
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 = []


Expand Down

0 comments on commit 18de1f2

Please sign in to comment.