aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-09-11 03:07:34 -0600
committerbors-servo <metajack+bors@gmail.com>2015-09-11 03:07:34 -0600
commit3a97455a65a8eafab313bd583a6b1f811605168f (patch)
tree073e40d06327fb000e5a799972e57e0ea6528164 /python/tidy.py
parenteb556c1ce6ed52e2a71743a088860ac0e0df3e89 (diff)
parentb9ffb80b7ca422c19eb405fc8610c8f5d77f0f63 (diff)
downloadservo-3a97455a65a8eafab313bd583a6b1f811605168f.tar.gz
servo-3a97455a65a8eafab313bd583a6b1f811605168f.zip
Auto merge of #7570 - jxs:ignore_length_tidy_script, r=Ms2ger
ignore length on .lock files on tidy.py, closes #7569 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7570) <!-- Reviewable:end -->
Diffstat (limited to 'python/tidy.py')
-rw-r--r--python/tidy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/tidy.py b/python/tidy.py
index b2e94fcafca..d637c9178f6 100644
--- a/python/tidy.py
+++ b/python/tidy.py
@@ -72,7 +72,9 @@ def check_license(file_name, contents):
yield (1, "incorrect license")
-def check_length(idx, line):
+def check_length(file_name, idx, line):
+ if file_name.endswith(".lock"):
+ raise StopIteration
max_length = 120
if len(line) >= max_length:
yield (idx + 1, "Line is longer than %d characters" % max_length)
@@ -105,7 +107,7 @@ def check_by_line(file_name, contents):
lines = contents.splitlines(True)
for idx, line in enumerate(lines):
errors = itertools.chain(
- check_length(idx, line),
+ check_length(file_name, idx, line),
check_whitespace(idx, line),
check_whatwg_url(idx, line),
)