aboutsummaryrefslogtreecommitdiff
path: root/utils/lint
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2009-01-08 02:16:13 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2009-01-08 02:16:13 +0000
commitcb5852d1f7a45dcb3c8a56120ba16b2c1825c990 (patch)
treee820ee8440acd67a0fdde59775ab9ed9c20e94ab /utils/lint
parentef5dc7072fb96a66cc744c0fd6550def9e7f7159 (diff)
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
Diffstat (limited to 'utils/lint')
-rw-r--r--utils/lint/common_lint.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/lint/common_lint.py b/utils/lint/common_lint.py
index 9567031665..18263838b0 100644
--- a/utils/lint/common_lint.py
+++ b/utils/lint/common_lint.py
@@ -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