@@ -1810,7 +1810,7 @@ def CheckForCopyright(filename, lines, error):
18101810 """Logs an error if no Copyright message appears at the top of the file."""
18111811
18121812 # 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.
18141814 for line in xrange (1 , min (len (lines ), 11 )):
18151815 if re .search (r'Copyright' , lines [line ], re .I ): break
18161816 else : # means no copyright line was found
@@ -3947,9 +3947,9 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
39473947
39483948 # Block bodies should not be followed by a semicolon. Due to C++11
39493949 # 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 "}":
39533953 # 1. Some flavor of block following closing parenthesis:
39543954 # for (;;) {};
39553955 # while (...) {};
@@ -4005,11 +4005,11 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
40054005 # - INTERFACE_DEF
40064006 # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
40074007 #
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
40094009 # unsafe macros, even though the latter appears less frequently in
40104010 # 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
40134013 # would result in compile errors.
40144014 #
40154015 # In addition to macros, we also don't want to warn on
@@ -5209,20 +5209,20 @@ def CheckForNonConstReference(filename, clean_lines, linenum,
52095209 #
52105210 # We also accept & in static_assert, which looks like a function but
52115211 # it's actually a declaration expression.
5212- whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
5212+ allowed_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
52135213 r'operator\s*[<>][<>]|'
52145214 r'hash_append|'
52155215 r'static_assert|COMPILE_ASSERT'
52165216 r')\s*\(' )
5217- if Search (whitelisted_functions , line ):
5217+ if Search (allowed_functions , line ):
52185218 return
52195219 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
52215221 # didn't see any function name on this line, so this is likely a
52225222 # multi-line parameter list. Try a bit harder to catch this case.
52235223 for i in xrange (2 ):
52245224 if (linenum > i and
5225- Search (whitelisted_functions , clean_lines .elided [linenum - i - 1 ])):
5225+ Search (allowed_functions , clean_lines .elided [linenum - i - 1 ])):
52265226 return
52275227
52285228 decls = ReplaceAll (r'{[^}]*}' , ' ' , line ) # exclude function body
0 commit comments