mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
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  <!-- 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:
commit
18de1f2357
1 changed files with 4 additions and 1 deletions
|
@ -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 = []
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue