style: Strip newline when checking lines
authorAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 24 Mar 2016 11:11:34 +0000 (11:11 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 24 Mar 2016 11:11:34 +0000 (11:11 +0000)
The style checker incorrectly includes newlines when checking lines of
code, which effectively decreases the column limit by 1. This
changeset strips the newline character from before calling line
checkers.

Change-Id: I0a8c7707ece57d782d11cc86db4b8064db291ce0
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
util/style.py

index 7ee58dfa68d96b3300d3a8f2ad1bd0e9ab7f1e09..36d5ae0a1db8ac075af0fcf7be913e60687872e2 100644 (file)
@@ -236,6 +236,7 @@ class Verifier(object):
         for num,line in enumerate(f):
             if num not in regions:
                 continue
+            line = line.rstrip('\n')
             if not self.check_line(line):
                 self.write("invalid %s in %s:%d\n" % \
                            (self.test_name, filename, num + 1))