From 86a34c5bd6a2bb182b83a4524b62df7bbcd0c887 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 31 Aug 2022 09:14:53 +0100 Subject: [PATCH] `typecheck_typeshed.py`: Make `dir` command-line argument positional-only (#8646) --- tests/typecheck_typeshed.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/typecheck_typeshed.py b/tests/typecheck_typeshed.py index f602f8974..e2798ddca 100644 --- a/tests/typecheck_typeshed.py +++ b/tests/typecheck_typeshed.py @@ -17,6 +17,13 @@ SUPPORTED_VERSIONS = ("3.11", "3.10", "3.9") DIRECTORIES_TO_TEST = ("scripts", "tests") parser = argparse.ArgumentParser(description="Run mypy on typeshed's own code in the `scripts` and `tests` directories.") +parser.add_argument( + "dir", + choices=DIRECTORIES_TO_TEST + ([],), + nargs="*", + action="extend", + help=f"Test only these top-level typeshed directories (defaults to {DIRECTORIES_TO_TEST!r})", +) parser.add_argument( "--platform", choices=SUPPORTED_PLATFORMS, @@ -32,14 +39,6 @@ parser.add_argument( action="extend", help="Run mypy for certain Python versions (defaults to sys.version_info[:2])", ) -parser.add_argument( - "-d", - "--dir", - choices=DIRECTORIES_TO_TEST, - nargs="*", - action="extend", - help=f"Test only these top-level typeshed directories (defaults to {DIRECTORIES_TO_TEST!r})", -) def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> ReturnCode: