Rename whitelist to allowlist (#5614)

Resolves #4436

I want to add stubtest for third party stubs, and figured it'd be easier
to make this change now.

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2021-06-10 14:33:44 -07:00
committed by GitHub
parent c4dc935b3f
commit e66ceceed0
30 changed files with 40 additions and 40 deletions

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env python3
# Runs stubtest and prints each unused whitelist entry with filename.
# Runs stubtest and prints each unused allowlist entry with filename.
import subprocess
import sys
from pathlib import Path
from typing import List, Tuple
_UNUSED_NOTE = "note: unused allowlist entry "
_WHITELIST_PATH = Path("tests") / "stubtest_whitelists"
_ALLOWLIST_PATH = Path("tests") / "stubtest_allowlists"
def main() -> None:
@@ -30,11 +30,11 @@ def unused_files(unused: str) -> List[Tuple[str, str]]:
files = ["py3_common.txt", version + ".txt", sys.platform + ".txt", sys.platform + "-" + version + ".txt"]
found = []
for file in files:
path = _WHITELIST_PATH / file
path = _ALLOWLIST_PATH / file
if find_unused_in_file(unused, path):
found.append((path.as_posix(), unused))
if not found:
raise ValueError("unused item {} not found in any whitelist file".format(unused))
raise ValueError("unused item {} not found in any allowlist file".format(unused))
return found