mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 09:54:09 +00:00
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
This commit is contained in:
parent
ef5dc7072f
commit
cb5852d1f7
@ -15,7 +15,7 @@ def VerifyLineLength(filename, lines, max_length):
|
||||
"""
|
||||
line_num = 1
|
||||
for line in lines:
|
||||
length = len(line.rstrip()) # strip off EOL char(s)
|
||||
length = len(line.rstrip())
|
||||
if length > max_length:
|
||||
print '%s:%d:Line exceeds %d chars (%d)' % (filename, line_num,
|
||||
max_length, length)
|
||||
@ -32,7 +32,7 @@ def VerifyTrailingWhitespace(filename, lines):
|
||||
trailing_whitespace_re = re.compile(r'\s+$')
|
||||
line_num = 1
|
||||
for line in lines:
|
||||
if trailing_whitespace_re.match(line):
|
||||
if trailing_whitespace_re.match(line.rstrip()):
|
||||
print '%s:%d:Trailing whitespace' % (filename, line_num)
|
||||
line_num += 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user