diff --git a/cpplint/cpplint.py b/cpplint/cpplint.py index be10764..86154ed 100755 --- a/cpplint/cpplint.py +++ b/cpplint/cpplint.py @@ -1736,9 +1736,12 @@ def CheckSpacing(filename, clean_lines, linenum, error): # but some lines are exceptions -- e.g. if they're big # comment delimiters like: # //---------------------------------------------------------- + # or are an empty C++ style Doxygen comment, like: + # /// # or they begin with multiple slashes followed by a space: # //////// Header comment match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or + Search(r'^/$', line[commentend:]) or Search(r'^/+ ', line[commentend:])) if not match: error(filename, linenum, 'whitespace/comments', 4, diff --git a/cpplint/cpplint_unittest.py b/cpplint/cpplint_unittest.py index 7470f13..ea39f9c 100755 --- a/cpplint/cpplint_unittest.py +++ b/cpplint/cpplint_unittest.py @@ -1511,6 +1511,7 @@ class CpplintTest(CpplintTestBase): self.TestLint('//////', '') self.TestLint('////// x', '') self.TestLint('/// x', '') + self.TestLint('///', '') # Empty Doxygen comment self.TestLint('////x', 'Should have a space between // and comment' ' [whitespace/comments] [4]')