mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
typecheck_typeshed.py: Make dir command-line argument positional-only (#8646)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user