CodeInclusion: Rename whitelist/blacklist -> allowlist/blocklist
Migrate to more inclusive terminology.
Bug: 1097674
Change-Id: I387b385ff36c7766682c06af34ed5fc6115119d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2268403
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
diff --git a/cpplint.py b/cpplint.py
index daf6068..0d4a799 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -3748,8 +3748,8 @@
# Block bodies should not be followed by a semicolon. Due to C++11
# brace initialization, there are more places where semicolons are
- # required than not, so we use a whitelist approach to check these
- # rather than a blacklist. These are the places where "};" should
+ # required than not, so we use an allowlist approach to check these
+ # rather than a blocklist. These are the places where "};" should
# be replaced by just "}":
# 1. Some flavor of block following closing parenthesis:
# for (;;) {};
@@ -3806,11 +3806,11 @@
# - INTERFACE_DEF
# - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
#
- # We implement a whitelist of safe macros instead of a blacklist of
+ # We implement an allowlist of safe macros instead of a blocklist of
# unsafe macros, even though the latter appears less frequently in
- # google code and would have been easier to implement. This is because
- # the downside for getting the whitelist wrong means some extra
- # semicolons, while the downside for getting the blacklist wrong
+ # google code and would have been easier to implement. This is because
+ # the downside for getting the allowlist wrong means some extra
+ # semicolons, while the downside for getting the blocklist wrong
# would result in compile errors.
#
# In addition to macros, we also don't want to warn on
@@ -4991,19 +4991,19 @@
#
# We also accept & in static_assert, which looks like a function but
# it's actually a declaration expression.
- whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
+ allowlisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
r'operator\s*[<>][<>]|'
r'static_assert|COMPILE_ASSERT'
r')\s*\(')
- if Search(whitelisted_functions, line):
+ if Search(allowlisted_functions, line):
return
elif not Search(r'\S+\([^)]*$', line):
- # Don't see a whitelisted function on this line. Actually we
+ # Don't see an allowlisted function on this line. Actually we
# didn't see any function name on this line, so this is likely a
# multi-line parameter list. Try a bit harder to catch this case.
for i in range(2):
if (linenum > i and
- Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
+ Search(allowlisted_functions, clean_lines.elided[linenum - i - 1])):
return
decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body
diff --git a/gclient_eval.py b/gclient_eval.py
index c437b50..a6dd03b 100644
--- a/gclient_eval.py
+++ b/gclient_eval.py
@@ -135,7 +135,7 @@
_GCLIENT_SCHEMA = schema.Schema(
_NodeDictSchema({
- # List of host names from which dependencies are allowed (whitelist).
+ # List of host names from which dependencies are allowed (allowlist).
# NOTE: when not present, all hosts are allowed.
# NOTE: scoped to current DEPS file, not recursive.
schema.Optional('allowed_hosts'): [schema.Optional(basestring)],
@@ -187,7 +187,7 @@
# Recursion limit for nested DEPS.
schema.Optional('recursion'): int,
- # Whitelists deps for which recursion should be enabled.
+ # Allowlists deps for which recursion should be enabled.
schema.Optional('recursedeps'): [
schema.Optional(schema.Or(
basestring,
@@ -196,7 +196,7 @@
)),
],
- # Blacklists directories for checking 'include_rules'.
+ # Blocklists directories for checking 'include_rules'.
schema.Optional('skip_child_includes'): [schema.Optional(basestring)],
# Mapping from paths to include rules specific for that path.
diff --git a/gclient_utils.py b/gclient_utils.py
index 8267b96..c62d589 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -49,7 +49,7 @@
# These repos are known to cause OOM errors on 32-bit platforms, due the the
# very large objects they contain. It is not safe to use threaded index-pack
# when cloning/fetching them.
-THREADED_INDEX_PACK_BLACKLIST = [
+THREADED_INDEX_PACK_BLOCKLIST = [
'https://chromium.googlesource.com/chromium/reference_builds/chrome_win.git'
]
@@ -1193,7 +1193,7 @@
performance."""
cache_limit = DefaultDeltaBaseCacheLimit()
result = ['-c', 'core.deltaBaseCacheLimit=%s' % cache_limit]
- if url in THREADED_INDEX_PACK_BLACKLIST:
+ if url in THREADED_INDEX_PACK_BLOCKLIST:
result.extend(['-c', 'pack.threads=1'])
return result
diff --git a/git_footers.py b/git_footers.py
index 8d959f2..b882ac3 100755
--- a/git_footers.py
+++ b/git_footers.py
@@ -17,7 +17,7 @@
FOOTER_PATTERN = re.compile(r'^\s*([\w-]+): *(.*)$')
CHROME_COMMIT_POSITION_PATTERN = re.compile(r'^([\w/\-\.]+)@{#(\d+)}$')
-FOOTER_KEY_BLACKLIST = set(['http', 'https'])
+FOOTER_KEY_BLOCKLIST = set(['http', 'https'])
def normalize_name(header):
@@ -27,7 +27,7 @@
def parse_footer(line):
"""Returns footer's (key, value) if footer is valid, else None."""
match = FOOTER_PATTERN.match(line)
- if match and match.group(1) not in FOOTER_KEY_BLACKLIST:
+ if match and match.group(1) not in FOOTER_KEY_BLOCKLIST:
return (match.group(1), match.group(2))
return None
diff --git a/pylintrc b/pylintrc
index 5690f27..326a855 100644
--- a/pylintrc
+++ b/pylintrc
@@ -7,7 +7,7 @@
# pygtk.require().
#init-hook=
-# Add files or directories to the blacklist. They should be base names, not
+# Add files or directories to the blocklist. They should be base names, not
# paths.
ignore=CVS