8000 Don't show docs links for plugin error codes (#16383) · python/mypy@14f79c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 14f79c1

Browse files
authored
Don't show docs links for plugin error codes (#16383)
Fixes #16375
1 parent 4291b2c commit 14f79c1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mypy/errorcodes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,6 @@ def __hash__(self) -> int:
274274
"General",
275275
sub_code_of=MISC,
276276
)
277+
278+
# This copy will not include any error codes defined later in the plugins.
279+
mypy_error_codes = error_codes.copy()

mypy/errors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing_extensions import Literal, TypeAlias as _TypeAlias
99

1010
from mypy import errorcodes as codes
11-
from mypy.errorcodes import IMPORT, IMPORT_NOT_FOUND, IMPORT_UNTYPED, ErrorCode
11+
from mypy.errorcodes import IMPORT, IMPORT_NOT_FOUND, IMPORT_UNTYPED, ErrorCode, mypy_error_codes
1212
from mypy.message_registry import ErrorMessage
1313
from mypy.options import Options
1414
from mypy.scope import Scope
@@ -560,6 +560,7 @@ def add_error_info(self, info: ErrorInfo) -> None:
560560
and not self.options.hide_error_codes
561561
and info.code is not None
562562
and info.code not in HIDE_LINK_CODES
563+
and info.code.code in mypy_error_codes
563564
):
564565
message = f"See {BASE_RTD_URL}-{info.code.code} for more info"
565566
if message in self.only_once_messages:

0 commit comments

Comments
 (0)
0