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

Method report_simple_error

mypy/errors.py:730–753  ·  view source on GitHub ↗

Generate a simple error in a module. This skip the logic in add_error_info() and goes to _add_error_info().

(
        self, file: str, line: int, message: str, code: ErrorCode | None
    )

Source from the content-addressed store, hash-verified

728 self._add_error_info(file, info)
729
730 def report_simple_error(
731 self, file: str, line: int, message: str, code: ErrorCode | None
732 ) -> None:
733 """Generate a simple error in a module.
734
735 This skip the logic in add_error_info() and goes to _add_error_info().
736 """
737 info = ErrorInfo(
738 import_ctx=self.import_context(),
739 local_ctx=(None, None),
740 line=line,
741 column=-1,
742 end_line=line,
743 end_column=-1,
744 severity="error",
745 message=message,
746 code=code,
747 blocker=False,
748 only_once=False,
749 module=self.current_module(),
750 # TODO: can we support more precise targets?
751 target=self.target_module,
752 )
753 self._add_error_info(file, info)
754
755 def get_watchers(self) -> Iterator[ErrorWatcher]:
756 """Yield the `ErrorWatcher` stack from top to bottom."""

Calls 4

import_contextMethod · 0.95
current_moduleMethod · 0.95
_add_error_infoMethod · 0.95
ErrorInfoClass · 0.85

Tested by

no test coverage detected