mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user