aboutsummaryrefslogtreecommitdiff
path: root/run_mypy.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-02-08 15:21:05 -0500
committerEli Schwartz <eschwartz@archlinux.org>2023-03-02 15:33:19 -0500
commit6c3b0973c4c1b9444df65c4a33bdcca5e7c3eab0 (patch)
treeba33445706b014030c90db538919fcc36b53e887 /run_mypy.py
parent47f3263165b789ff782db9bd71ef6859561da143 (diff)
downloadmeson-6c3b0973c4c1b9444df65c4a33bdcca5e7c3eab0.zip
meson-6c3b0973c4c1b9444df65c4a33bdcca5e7c3eab0.tar.gz
meson-6c3b0973c4c1b9444df65c4a33bdcca5e7c3eab0.tar.bz2
run_mypy: passthrough unknown options to mypy itself
Useful for running as a thin wrapper in other contexts that expect the ability to run mypy itself with arbitrary arguments.
Diffstat (limited to 'run_mypy.py')
-rwxr-xr-xrun_mypy.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/run_mypy.py b/run_mypy.py
index 6683560..2db0fcc 100755
--- a/run_mypy.py
+++ b/run_mypy.py
@@ -93,7 +93,6 @@ def main() -> int:
check_mypy()
root = Path(__file__).absolute().parent
- args = [] # type: T.List[str]
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('files', nargs='*')
@@ -101,7 +100,7 @@ def main() -> int:
parser.add_argument('-p', '--pretty', action='store_true', help='pretty print mypy errors')
parser.add_argument('-C', '--clear', action='store_true', help='clear the terminal before running mypy')
- opts = parser.parse_args()
+ opts, args = parser.parse_known_args()
if opts.pretty:
args.append('--pretty')