MCPcopy Index your code
hub / github.com/python/mypy / add_report

Method add_report

mypy/report.py:67–86  ·  view source on GitHub ↗
(self, report_type: str, report_dir: str)

Source from the content-addressed store, hash-verified

65 self.add_report(report_type, report_dir)
66
67 def add_report(self, report_type: str, report_dir: str) -> AbstractReporter:
68 try:
69 return self.named_reporters[report_type]
70 except KeyError:
71 pass
72 reporter_cls, needs_lxml = reporter_classes[report_type]
73 if needs_lxml and not LXML_INSTALLED:
74 print(
75 (
76 "You must install the lxml package before you can run mypy"
77 " with `--{}-report`.\n"
78 "You can do this with `python3 -m pip install lxml`."
79 ).format(report_type),
80 file=sys.stderr,
81 )
82 raise ImportError
83 reporter = reporter_cls(self, report_dir)
84 self.reporters.append(reporter)
85 self.named_reporters[report_type] = reporter
86 return reporter
87
88 def file(
89 self,

Callers 2

__init__Method · 0.95
__init__Method · 0.80

Calls 3

printFunction · 0.85
appendMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected