Update cpplint.py to #114:

- Prevent invalid increment constructs
- Allow long URLs in lines without hitting the 80 char limit
- Prevent false positives of "Extra space after ( in function call" in macro definitions.
This commit is contained in:
erg@google.com
2009-03-25 21:18:36 +00:00
parent f1dcb61af8
commit 3664910272
2 changed files with 42 additions and 3 deletions
+9
View File
@@ -258,6 +258,9 @@ class CpplintTest(CpplintTestBase):
'// https://g' + ('o' * 60) + 'gle.com/ and some comments',
'Lines should be <= 80 characters long'
' [whitespace/line_length] [2]')
self.TestLint(
'// Read https://g' + ('o' * 60) + 'gle.com/' ,
'')
# Test Variable Declarations.
def testVariableDeclarations(self):
@@ -1098,6 +1101,8 @@ class CpplintTest(CpplintTestBase):
self.TestLint('switch (foo) {', '')
self.TestLint('foo( bar)', 'Extra space after ( in function call'
' [whitespace/parens] [4]')
self.TestLint('foobar( \\', '')
self.TestLint('foobar( \\', '')
self.TestLint('( a + b)', 'Extra space after ('
' [whitespace/parens] [2]')
self.TestLint('((a+b))', '')
@@ -1911,6 +1916,10 @@ class CpplintTest(CpplintTestBase):
if message.find('legal/copyright') != -1:
self.fail('Unexpected error: %s' % message)
def testInvalidIncrement(self):
self.TestLint('*count++;',
'Changing pointer instead of value (or unused value of '
'operator*). [runtime/invalid_increment] [5]')
class CleansedLinesTest(unittest.TestCase):
def testInit(self):