aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
authorJoão Oliveira <hello@jxs.pt>2015-09-09 05:04:42 +0100
committerJoão Oliveira <hello@jxs.pt>2015-09-09 14:02:43 +0100
commitb9ffb80b7ca422c19eb405fc8610c8f5d77f0f63 (patch)
treec7d272686aadab1f9fcc35f30c6365804938acf6 /python/tidy.py
parent4221b354cfc05e4857ba4c1a160298965e243330 (diff)
downloadservo-b9ffb80b7ca422c19eb405fc8610c8f5d77f0f63.tar.gz
servo-b9ffb80b7ca422c19eb405fc8610c8f5d77f0f63.zip
ignore length on .lock files on tidy.py,
closes #7569
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 95691893525..36c848514dd 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),
)