MCPcopy
hub / github.com/python/mypy / check

Method check

mypy/dmypy_server.py:419–442  ·  view source on GitHub ↗

Check using fine-grained incremental mode. If is_tty is True format the output nicely with colors and summary line (unless disabled in self.options). Also pass the terminal_width to formatter.

(
        self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int
    )

Source from the content-addressed store, hash-verified

417 return res
418
419 def check(
420 self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int
421 ) -> dict[str, Any]:
422 """Check using fine-grained incremental mode.
423
424 If is_tty is True format the output nicely with colors and summary line
425 (unless disabled in self.options). Also pass the terminal_width to formatter.
426 """
427 old_export_types = self.options.export_types
428 self.options.export_types = self.options.export_types or export_types
429 if not self.fine_grained_manager:
430 res = self.initialize_fine_grained(sources, is_tty, terminal_width)
431 else:
432 if not self.following_imports():
433 messages = self.fine_grained_increment(sources, explicit_export_types=export_types)
434 else:
435 messages = self.fine_grained_increment_follow_imports(
436 sources, explicit_export_types=export_types
437 )
438 res = self.increment_output(messages, sources, is_tty, terminal_width)
439 self.flush_caches()
440 self.update_stats(res)
441 self.options.export_types = old_export_types
442 return res
443
444 def flush_caches(self) -> None:
445 self.fscache.flush()

Callers 3

cmd_runMethod · 0.95
cmd_checkMethod · 0.95
run_checkMethod · 0.80

Calls 7

following_importsMethod · 0.95
increment_outputMethod · 0.95
flush_cachesMethod · 0.95
update_statsMethod · 0.95

Tested by 1

run_checkMethod · 0.64