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

Method clear_errors_in_targets

mypy/errors.py:893–906  ·  view source on GitHub ↗

Remove errors in specific fine-grained targets within a file.

(self, path: str, targets: set[str])

Source from the content-addressed store, hash-verified

891 return error_code.default_enabled
892
893 def clear_errors_in_targets(self, path: str, targets: set[str]) -> None:
894 """Remove errors in specific fine-grained targets within a file."""
895 if path in self.error_info_map:
896 new_errors = []
897 has_blocker = False
898 for info in self.error_info_map[path]:
899 if info.target not in targets:
900 new_errors.append(info)
901 has_blocker |= info.blocker
902 elif info.only_once:
903 self.only_once_messages.remove(info.message)
904 self.error_info_map[path] = new_errors
905 if not has_blocker and path in self.has_blockers:
906 self.has_blockers.remove(path)
907
908 def generate_unused_ignore_errors(self, file: str, is_typeshed: bool = False) -> None:
909 if is_typeshed or file in self.ignored_files:

Callers 1

reprocess_nodesFunction · 0.80

Calls 2

appendMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected