typing: add convinient option to clear the terminal to run_mypy.py

pull/7794/head
Daniel Mensinger 4 years ago
parent 19b3f65e70
commit 9f695435e7
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 5
      run_mypy.py

@ -55,11 +55,16 @@ def main() -> int:
parser = argparse.ArgumentParser(description='Process some integers.')
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()
if opts.pretty:
args.append('--pretty')
if opts.clear:
print('\x1bc', end='', flush=True)
print('Running mypy (this can take some time) ...')
p = subprocess.run(
[sys.executable, '-m', 'mypy'] + args + modules,
cwd=root,

Loading…
Cancel
Save