diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-08-28 03:35:53 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-08-28 03:35:53 -0600 |
commit | 18de1f2357144d86ea83cd0cb66922e8a2157597 (patch) | |
tree | 64de244f28bacac3c6d34b76bada5aac2de62751 /python/tidy.py | |
parent | 6431e8da43817e8a6b1e4757afbcf45c1a629707 (diff) | |
parent | 6ef5c8eec2b54e3a10def9231553ba1ab44f6714 (diff) | |
download | servo-18de1f2357144d86ea83cd0cb66922e8a2157597.tar.gz servo-18de1f2357144d86ea83cd0cb66922e8a2157597.zip |
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 -->
Diffstat (limited to 'python/tidy.py')
-rw-r--r-- | python/tidy.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/tidy.py b/python/tidy.py index 43ff23aeff5..9ea9de24f30 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -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 = [] |