Fix indentation check for access keywords

No whitespace before the access keywords in class/struct declarations
should be acceptable. The behavior of the check correctly reflects the
comment.
This commit is contained in:
Henry Chan 2017-06-20 16:29:17 -07:00
parent 142b0e64ba
commit 3bf9a5f09f

2
cpplint/cpplint.py vendored
View File

@ -2596,7 +2596,7 @@ class NestingState(object):
# check if the keywords are not preceded by whitespaces. # check if the keywords are not preceded by whitespaces.
indent = access_match.group(1) indent = access_match.group(1)
if (len(indent) != classinfo.class_indent + 1 and if (len(indent) != classinfo.class_indent + 1 and
Match(r'^\s*$', indent)): Match(r'^\s+$', indent)):
if classinfo.is_struct: if classinfo.is_struct:
parent = 'struct ' + classinfo.name parent = 'struct ' + classinfo.name
else: else: