@@ -1810,7 +1810,7 @@ def CheckForCopyright(filename, lines, error):
1810
1810
"""Logs an error if no Copyright message appears at the top of the file."""
1811
1811
1812
1812
# We'll say it should occur by line 10. Don't forget there's a
1813
- # dummy line at the front.
1813
+ # placeholder line at the front.
1814
1814
for line in xrange (1 , min (len (lines ), 11 )):
1815
1815
if re .search (r'Copyright' , lines [line ], re .I ): break
1816
1816
else : # means no copyright line was found
@@ -3947,9 +3947,9 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
3947
3947
3948
3948
# Block bodies should not be followed by a semicolon. Due to C++11
3949
3949
# brace initialization, there are more places where semicolons are
3950
- # required than not, so we use a whitelist approach to check these
3951
- # rather than a blacklist . These are the places where "};" should
3952
- # be replaced by just "}":
3950
+ # required than not, so we explicitly list the allowed rules rather
3951
+ # than listing the disallowed ones . These are the places where "};"
3952
+ # should be replaced by just "}":
3953
3953
# 1. Some flavor of block following closing parenthesis:
3954
3954
# for (;;) {};
3955
3955
# while (...) {};
@@ -4005,11 +4005,11 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
4005
4005
# - INTERFACE_DEF
4006
4006
# - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
4007
4007
#
4008
- # We implement a whitelist of safe macros instead of a blacklist of
4008
+ # We implement a list of safe macros instead of a list of
4009
4009
# unsafe macros, even though the latter appears less frequently in
4010
4010
# google code and would have been easier to implement. This is because
4011
- # the downside for getting the whitelist wrong means some extra
4012
- # semicolons, while the downside for getting the blacklist wrong
4011
+ # the downside for getting the allowed checks wrong means some extra
4012
+ # semicolons, while the downside for getting disallowed checks wrong
4013
4013
# would result in compile errors.
4014
4014
#
4015
4015
# In addition to macros, we also don't want to warn on
@@ -5209,20 +5209,20 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
5209
5209
#
5210
5210
# We also accept & in static_assert, which looks like a function but
5211
5211
# it's actually a declaration expression.
5212
- whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5212
+ allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5213
5213
r'operator\s*[<>][<>]|'
5214
5214
r'hash_append|'
5215
5215
r'static_assert|COMPILE_ASSERT'
5216
5216
r')\s*\(' )
5217
- if Search (whitelisted_functions , line ):
5217
+ if Search (allowed_functions , line ):
5218
5218
return
5219
5219
elif not Search (r'\S+\([^)]*$' , line ):
5220
- # Don't see a whitelisted function on this line. Actually we
5220
+ # Don't see an allowed function on this line. Actually we
5221
5221
# didn't see any function name on this line, so this is likely a
5222
5222
# multi-line parameter list. Try a bit harder to catch this case.
5223
5223
for i in xrange (2 ):
5224
5224
if (linenum > i and
5225
- Search (whitelisted_functions , clean_lines .elided [linenum - i - 1 ])):
5225
+ Search (allowed_functions , clean_lines .elided [linenum - i - 1 ])):
5226
5226
return
5227
5227
5228
5228
decls = ReplaceAll (r'{[^}]*}' , ' ' , line ) # exclude function body
0 commit comments