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

Class Errors

mypyc/errors.py:7–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class Errors:
8 def __init__(self, options: Options) -> None:
9 self.num_errors = 0
10 self.num_warnings = 0
11 self._errors = mypy.errors.Errors(options, hide_error_codes=True)
12
13 def error(self, msg: str, path: str, line: int) -> None:
14 self._errors.set_file(path, None, self._errors.options)
15 self._errors.report(line, None, msg, severity="error")
16 self.num_errors += 1
17
18 def note(self, msg: str, path: str, line: int) -> None:
19 self._errors.set_file(path, None, self._errors.options)
20 self._errors.report(line, None, msg, severity="note")
21
22 def warning(self, msg: str, path: str, line: int) -> None:
23 self._errors.set_file(path, None, self._errors.options)
24 self._errors.report(line, None, msg, severity="warning")
25 self.num_warnings += 1
26
27 def new_messages(self) -> list[str]:
28 return self._errors.new_messages()
29
30 def flush_errors(self) -> None:
31 for error in self.new_messages():
32 print(error)

Callers 6

generate_cFunction · 0.90
tokenizer_format_callFunction · 0.90
make_builderFunction · 0.90
run_case_stepMethod · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…