servo: Merge #7692 - Raise max length error over 120 chars not at 120 chars. python/tidy.py (from ddrmanxbxfr:TidyMaxLineOver120); r=nox

This is a follow up of issue : Tidy has an off-by-one error #7686

It allows to raise the max length error when line is over than 120 not at 120 specifically.

Thanks for looking into it.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8f1469eb08a437bcc6cfb510334be2b6430b4a8f
This commit is contained in:
Mathieu Rheaume
2015-09-23 04:17:16 -06:00
parent d1e41c7e28
commit f96adb1667

View File

@@ -76,7 +76,7 @@ def check_length(file_name, idx, line):
if file_name.endswith(".lock"):
raise StopIteration
max_length = 120
if len(line) >= max_length:
if len(line.rstrip('\n')) > max_length:
yield (idx + 1, "Line is longer than %d characters" % max_length)