mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +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:
@@ -53,7 +53,7 @@ find $REPO_ROOT/stubs/protobuf/ -name "*_pb2.pyi" -delete
|
||||
|
||||
# Roughly reproduce the subset of .proto files on the public interface as described
|
||||
# by find_package_modules in the protobuf setup.py.
|
||||
# The logic (as of 3.14.0) can roughly be described as a whitelist of .proto files
|
||||
# The logic (as of 3.14.0) can roughly be described as a allowlist of .proto files
|
||||
# further limited to exclude *test* and internal/
|
||||
# https://github.com/protocolbuffers/protobuf/blob/master/python/setup.py
|
||||
PROTO_FILES=$(grep "generate_proto.*google" $PYTHON_PROTOBUF_DIR/python/setup.py | \
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# This script removes lines from stubtest whitelists, according to
|
||||
# This script removes lines from stubtest allowlists, according to
|
||||
# an input file. The input file has one entry to remove per line.
|
||||
# Each line consists of a whitelist filename and an entry, separated
|
||||
# Each line consists of a allowlist filename and an entry, separated
|
||||
# by a colon.
|
||||
|
||||
# This script is used by the workflow to remove unused whitelist entries.
|
||||
# This script is used by the workflow to remove unused allowlist entries.
|
||||
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
@@ -19,7 +19,7 @@ def main() -> None:
|
||||
|
||||
to_remove = parse_input_file(sys.argv[1])
|
||||
for filename, entries in to_remove.items():
|
||||
remove_entries_from_whitelist(filename, entries)
|
||||
remove_entries_from_allowlist(filename, entries)
|
||||
|
||||
|
||||
def parse_input_file(input_file: str) -> Dict[str, Set[str]]:
|
||||
@@ -37,7 +37,7 @@ def parse_input_line(line: str) -> Tuple[str, str]:
|
||||
return filename, entry
|
||||
|
||||
|
||||
def remove_entries_from_whitelist(filename: str, entries: Set[str]) -> None:
|
||||
def remove_entries_from_allowlist(filename: str, entries: Set[str]) -> None:
|
||||
new_lines: List[str] = []
|
||||
with open(filename) as f:
|
||||
for line in f:
|
||||
Reference in New Issue
Block a user