Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mypy/errorcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,6 @@ def __hash__(self) -> int:
"General",
sub_code_of=MISC,
)

# This copy will not include any error codes defined later in the plugins.
mypy_error_codes = error_codes.copy()
3 changes: 2 additions & 1 deletion mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing_extensions import Literal, TypeAlias as _TypeAlias

from mypy import errorcodes as codes
from mypy.errorcodes import IMPORT, IMPORT_NOT_FOUND, IMPORT_UNTYPED, ErrorCode
from mypy.errorcodes import IMPORT, IMPORT_NOT_FOUND, IMPORT_UNTYPED, ErrorCode, mypy_error_codes
from mypy.message_registry import ErrorMessage
from mypy.options import Options
from mypy.scope import Scope
Expand Down Expand Up @@ -560,6 +560,7 @@ def add_error_info(self, info: ErrorInfo) -> None:
and not self.options.hide_error_codes
and info.code is not None
and info.code not in HIDE_LINK_CODES
and info.code.code in mypy_error_codes
):
message = f"See {BASE_RTD_URL}-{info.code.code} for more info"
if message in self.only_once_messages:
Expand Down