Allow blank Doxygen-style comments. Patch by mball@google.com.

This commit is contained in:
erg@google.com 2010-11-17 18:09:31 +00:00
parent f550116b81
commit a51c16b542
2 changed files with 4 additions and 0 deletions

3
cpplint/cpplint.py vendored
View File

@ -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,

View File

@ -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]')