@@ -3866,8 +3866,8 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
3866
3866
3867
3867
# Block bodies should not be followed by a semicolon. Due to C++11
3868
3868
# brace initialization, there are more places where semicolons are
3869
- # required than not, so we use a whitelist approach to check these
3870
- # rather than a blacklist . These are the places where "};" should
3869
+ # required than not, so we use an allowlist approach to check these
3870
+ # rather than a denylist . These are the places where "};" should
3871
3871
# be replaced by just "}":
3872
3872
# 1. Some flavor of block following closing parenthesis:
3873
3873
# for (;;) {};
@@ -3924,11 +3924,11 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
3924
3924
# - INTERFACE_DEF
3925
3925
# - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
3926
3926
#
3927
- # We implement a whitelist of safe macros instead of a blacklist of
3927
+ # We implement an allowlist of safe macros instead of a denylist of
3928
3928
# unsafe macros, even though the latter appears less frequently in
3929
3929
# google code and would have been easier to implement. This is because
3930
- # the downside for getting the whitelist wrong means some extra
3931
- # semicolons, while the downside for getting the blacklist wrong
3930
+ # the downside for getting the allowlist wrong means some extra
3931
+ # semicolons, while the downside for getting the denylist wrong
3932
3932
# would result in compile errors.
3933
3933
#
3934
3934
# In addition to macros, we also don't want to warn on
@@ -5124,19 +5124,19 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
5124
5124
#
5125
5125
# We also accept & in static_assert, which looks like a function but
5126
5126
# it's actually a declaration expression.
5127
- whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5127
+ allowlisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5128
5128
r'operator\s*[<>][<>]|'
5129
5129
r'static_assert|COMPILE_ASSERT'
5130
5130
r')\s*\(' )
5131
- if Search (whitelisted_functions , line ):
5131
+ if Search (allowlisted_functions , line ):
5132
5132
return
5133
5133
elif not Search (r'\S+\([^)]*$' , line ):
5134
- # Don't see a whitelisted function on this line. Actually we
5134
+ # Don't see an allowlisted function on this line. Actually we
5135
5135
# didn't see any function name on this line, so this is likely a
5136
5136
# multi-line parameter list. Try a bit harder to catch this case.
5137
5137
for i in xrange (2 ):
5138
5138
if (linenum > i and
5139
- Search (whitelisted_functions , clean_lines .elided [linenum - i - 1 ])):
5139
+ Search (allowlisted_functions , clean_lines .elided [linenum - i - 1 ])):
5140
5140
return
5141
5141
5142
5142
decls = ReplaceAll (r'{[^}]*}' , ' ' , line ) # exclude function body
0 commit comments