aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy/tidy.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-11-06 13:38:52 -0500
committerGitHub <noreply@github.com>2018-11-06 13:38:52 -0500
commit6878dbbbeaa59b21a7b3608b6d6a911e88c1e443 (patch)
treef4a13f7d59c7f72c51e30755d1097595764f96c0 /python/tidy/servo_tidy/tidy.py
parent8df38f5e29d0005b792d403c3c54d35748448100 (diff)
parent8757cf5bc084ee23db643e283ca7e9fef143d810 (diff)
downloadservo-6878dbbbeaa59b21a7b3608b6d6a911e88c1e443.tar.gz
servo-6878dbbbeaa59b21a7b3608b6d6a911e88c1e443.zip
Auto merge of #22086 - servo:2018-without-stylo, r=SimonSapin
Switch some crates to the 2018 edition This is the subset of https://github.com/servo/servo/pull/22083 that doesn’t affect Gecko at all, so it isn’t blocked. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22086) <!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy/tidy.py')
-rw-r--r--python/tidy/servo_tidy/tidy.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 192e784efd6..9059c1f9843 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -256,10 +256,18 @@ def check_length(file_name, idx, line):
# Prefer shorter lines when shell scripting.
max_length = 80 if file_name.endswith(".sh") else 120
- if len(line.rstrip('\n')) > max_length:
+ if len(line.rstrip('\n')) > max_length and not is_unsplittable(file_name, line):
yield (idx + 1, "Line is longer than %d characters" % max_length)
+def is_unsplittable(file_name, line):
+ return (
+ file_name.endswith(".rs") and
+ line.startswith("use ") and
+ "{" not in line
+ )
+
+
def check_whatwg_specific_url(idx, line):
match = re.search(r"https://html\.spec\.whatwg\.org/multipage/[\w-]+\.html#([\w\:-]+)", line)
if match is not None: