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

Method set_file

mypy/errors.py:550–563  ·  view source on GitHub ↗

Set the path and module id of the current file.

(
        self, file: str, module: str | None, options: Options, scope: Scope | None = None
    )

Source from the content-addressed store, hash-verified

548 return remove_path_prefix(file, self.ignore_prefix)
549
550 def set_file(
551 self, file: str, module: str | None, options: Options, scope: Scope | None = None
552 ) -> None:
553 """Set the path and module id of the current file."""
554 # The path will be simplified later, in render_messages. That way
555 # * 'file' is always a key that uniquely identifies a source file
556 # that mypy read (simplified paths might not be unique); and
557 # * we only have to simplify in one place, while still supporting
558 # reporting errors for files other than the one currently being
559 # processed.
560 self.file = file
561 self.target_module = module
562 self.scope = scope
563 self.options = options
564
565 def set_file_ignored_lines(
566 self, file: str, ignored_lines: dict[int, list[str]], ignore_all: bool = False

Callers 15

check_first_passMethod · 0.80
check_second_passMethod · 0.80
parseFunction · 0.80
load_plugins_from_configFunction · 0.80
__init__Method · 0.80
correct_rel_impMethod · 0.80
write_deps_cacheFunction · 0.80
write_plugins_snapshotFunction · 0.80
_load_json_fileFunction · 0.80
parse_fileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected