summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lint/common_lint.py
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
commit687501fdd4f60edcabb7b8ead951bc1a7138b765 (patch)
tree04564cf7d78e2ca52ae5187959eed446a6a148da /llvm/utils/lint/common_lint.py
parent2879c29274f5467b57115b9a8d1f334bf0e9462f (diff)
downloadbcm5719-llvm-687501fdd4f60edcabb7b8ead951bc1a7138b765.tar.gz
bcm5719-llvm-687501fdd4f60edcabb7b8ead951bc1a7138b765.zip
Be sure to ignore the end-of-line character when considering trailing
whitespace. llvm-svn: 61905
Diffstat (limited to 'llvm/utils/lint/common_lint.py')
-rw-r--r--llvm/utils/lint/common_lint.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/utils/lint/common_lint.py b/llvm/utils/lint/common_lint.py
index 95670316654..18263838b09 100644
--- a/llvm/utils/lint/common_lint.py
+++ b/llvm/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
OpenPOWER on IntegriCloud