[llvm-commits] [llvm] r61905 - /llvm/trunk/utils/lint/common_lint.py

Misha Brukman brukman+llvm at gmail.com
Wed Jan 7 18:16:14 PST 2009


Author: brukman
Date: Wed Jan  7 20:16:13 2009
New Revision: 61905

URL: http://llvm.org/viewvc/llvm-project?rev=61905&view=rev
Log:
Be sure to ignore the end-of-line character when considering trailing
whitespace.

Modified:
    llvm/trunk/utils/lint/common_lint.py

Modified: llvm/trunk/utils/lint/common_lint.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lint/common_lint.py?rev=61905&r1=61904&r2=61905&view=diff

==============================================================================
--- llvm/trunk/utils/lint/common_lint.py (original)
+++ llvm/trunk/utils/lint/common_lint.py Wed Jan  7 20:16:13 2009
@@ -15,7 +15,7 @@
   """
   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 @@
   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
 





More information about the llvm-commits mailing list