llvm.org GIT mirror llvm / cb5852d
Be sure to ignore the end-of-line character when considering trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61905 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 10 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1414 """
1515 line_num = 1
1616 for line in lines:
17 length = len(line.rstrip()) # strip off EOL char(s)
17 length = len(line.rstrip())
1818 if length > max_length:
1919 print '%s:%d:Line exceeds %d chars (%d)' % (filename, line_num,
2020 max_length, length)
3131 trailing_whitespace_re = re.compile(r'\s+$')
3232 line_num = 1
3333 for line in lines:
34 if trailing_whitespace_re.match(line):
34 if trailing_whitespace_re.match(line.rstrip()):
3535 print '%s:%d:Trailing whitespace' % (filename, line_num)
3636 line_num += 1
3737