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

Class ErrorInfo

mypy/errors.py:71–200  ·  view source on GitHub ↗

Representation of a single error message.

Source from the content-addressed store, hash-verified

69
70
71class ErrorInfo:
72 """Representation of a single error message."""
73
74 # Description of a sequence of imports that refer to the source file
75 # related to this error. Each item is a (path, line number) tuple.
76 import_ctx: list[tuple[str, int]]
77 # Type and function/method where this error occurred. Unqualified, may be None.
78 local_ctx: tuple[str | None, str | None]
79
80 # The line number related to this error within file.
81 line = 0 # -1 if unknown
82 # The column number related to this error with file.
83 column = 0 # -1 if unknown
84 # The end line number related to this error within file.
85 end_line = 0 # -1 if unknown
86 # The end column number related to this error with file.
87 end_column = 0 # -1 if unknown
88 # Either 'error' or 'note'
89 severity = ""
90 # The error message.
91 message = ""
92 # The error code.
93 code: ErrorCode | None = None
94
95 # If True, we should halt build after the file that generated this error.
96 blocker = False
97 # Only report this particular messages once per program.
98 only_once = False
99
100 # These two are used by the daemon:
101 # The fully-qualified id of the source module for this error.
102 module: str | None
103 # Fine-grained incremental target where this was reported
104 target: str | None
105
106 # Lines where `type: ignores` will have effect on this error, for most errors
107 # this is just [line]. But sometimes may be custom, e.g. for override errors
108 # in methods with multi-line definition.
109 origin_span: Iterable[int]
110 # For errors on the same line you can use this to customize their sorting
111 # (lower value means show first).
112 priority: int
113 # If True, don't show this message in output, but still record the error.
114 hidden = False
115
116 # For notes, specifies (optionally) the error this note is attached to. This is used to
117 # simplify error code matching and de-duplication logic for complex multi-line notes.
118 parent_error: ErrorInfo | None = None
119
120 def __init__(
121 self,
122 *,
123 import_ctx: list[tuple[str, int]],
124 local_ctx: tuple[str | None, str | None],
125 line: int,
126 column: int,
127 end_line: int,
128 end_column: int,

Callers 4

readMethod · 0.85
reportMethod · 0.85
note_for_infoMethod · 0.85
report_simple_errorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…