along long lines if they contain error msgs

This commit is contained in:
Niko Matsakis 2012-04-17 08:39:41 -07:00
parent f9eca218e1
commit 2b5ad256f5

View File

@ -31,7 +31,10 @@ try:
if line.endswith(" \n") or line.endswith("\t\n"):
report_err("trailing whitespace")
line_len = len(line)-2 if autocrlf else len(line)-1
if line_len > cols:
# Along long lines if they are part of an expected error message
# in a test, which is denoted with "//!":
if line_len > cols and "//!" not in line:
report_err("line longer than %d chars" % cols)
except UnicodeDecodeError, e:
report_err("UTF-8 decoding error " + str(e))