Skip to content

Commit 47f5b5f

Browse files
author
hauntsaninja
committed
stubtest: allow multiple whitelists
1 parent 433f41c commit 47f5b5f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/stubtest.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,13 @@ def main() -> int:
994994
)
995995
parser.add_argument(
996996
"--whitelist",
997-
help="Use file as a whitelist. Whitelists can be created with --generate-whitelist",
997+
action="append",
998+
metavar="FILE",
999+
default=[],
1000+
help=(
1001+
"Use file as a whitelist. Can be passed multiple times to combine multiple "
1002+
"whitelists. Whitelist can be created with --generate-whitelist"
1003+
),
9981004
)
9991005
parser.add_argument("--concise", action="store_true", help="Make output concise")
10001006
parser.add_argument(
@@ -1006,7 +1012,11 @@ def main() -> int:
10061012

10071013
# Load the whitelist. This is a series of strings corresponding to Error.object_desc
10081014
# Values in the dict will store whether we used the whitelist entry or not.
1009-
whitelist = {entry: False for entry in get_whitelist_entries(args.whitelist)}
1015+
whitelist = {
1016+
entry: False
1017+
for whitelist_file in args.whitelist
1018+
for entry in get_whitelist_entries(whitelist_file)
1019+
}
10101020

10111021
# If we need to generate a whitelist, we store Error.object_desc for each error here.
10121022
generated_whitelist = set()

0 commit comments

Comments
 (0)