From a51c16b542b19577a45096f5ddc4a3b2dfebb84c Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Wed, 17 Nov 2010 18:09:31 +0000 Subject: [PATCH] Allow blank Doxygen-style comments. Patch by mball@google.com. --- cpplint/cpplint.py | 3 +++ cpplint/cpplint_unittest.py | 1 + 2 files changed, 4 insertions(+) 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]')