servo: Merge #10751 - Report lines starting with && in tidy (from zwn:tidy-start-operator); r=Wafflespeanut

Partial implementation of the issue #10692 (the easy part).

Source-Repo: https://github.com/servo/servo
Source-Revision: d926b5d3762a101d5280266f806f2b979f73b695
This commit is contained in:
Zbynek Winkler
2016-04-22 10:40:06 -07:00
parent a287f99021
commit a2221f5bbe
14 changed files with 37 additions and 31 deletions

View File

@@ -378,6 +378,7 @@ def check_rust(file_name, lines):
(r": &Vec<", "use &[T] instead of &Vec<T>", no_filter),
# No benefit over using &str
(r": &String", "use &str instead of &String", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter),
]
for pattern, message, filter_func in regex_rules:
@@ -647,6 +648,7 @@ def scan(faster=False, progress=True):
error = None
for error in errors:
print "\r\033[94m{}\033[0m:\033[93m{}\033[0m: \033[91m{}\033[0m".format(*error)
print
if error is None:
print "\n\033[92mtidy reported no errors.\033[0m"
print "\033[92mtidy reported no errors.\033[0m"
return int(error is not None)