Do a check, starting (or restarting) the daemon as necessary Restarts the daemon if the running daemon reports that it is required (due to a configuration change, for example). Setting flags is a bit awkward; you have to use e.g.: dmypy run -- --strict a.py b.py ... since w
(args: argparse.Namespace)
| 375 | |
| 376 | @action(run_parser) |
| 377 | def do_run(args: argparse.Namespace) -> None: |
| 378 | """Do a check, starting (or restarting) the daemon as necessary |
| 379 | |
| 380 | Restarts the daemon if the running daemon reports that it is |
| 381 | required (due to a configuration change, for example). |
| 382 | |
| 383 | Setting flags is a bit awkward; you have to use e.g.: |
| 384 | |
| 385 | dmypy run -- --strict a.py b.py ... |
| 386 | |
| 387 | since we don't want to duplicate mypy's huge list of flags. |
| 388 | (The -- is only necessary if flags are specified.) |
| 389 | """ |
| 390 | if not is_running(args.status_file): |
| 391 | # Bad or missing status file or dead process; good to start. |
| 392 | start_server(args, allow_sources=True) |
| 393 | t0 = time.time() |
| 394 | response = request( |
| 395 | args.status_file, |
| 396 | "run", |
| 397 | version=__version__, |
| 398 | args=args.flags, |
| 399 | export_types=args.export_types, |
| 400 | ) |
| 401 | # If the daemon signals that a restart is necessary, do it |
| 402 | if "restart" in response: |
| 403 | print(f"Restarting: {response['restart']}") |
| 404 | restart_server(args, allow_sources=True) |
| 405 | response = request( |
| 406 | args.status_file, |
| 407 | "run", |
| 408 | version=__version__, |
| 409 | args=args.flags, |
| 410 | export_types=args.export_types, |
| 411 | ) |
| 412 | |
| 413 | t1 = time.time() |
| 414 | response["roundtrip_time"] = t1 - t0 |
| 415 | check_output(response, args.verbose, args.junit_xml, args.perf_stats_file) |
| 416 | |
| 417 | |
| 418 | @action(status_parser) |
nothing calls this directly
no test coverage detected
searching dependent graphs…