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.
pull/11486/head
Eli Schwartz 2 years ago
parent 47f3263165
commit 6c3b0973c4
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 3
      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')

Loading…
Cancel
Save