You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support custom error codes in options check #19953
Feature
mypy options check should recognize custom error codes defined in plugins
Pitch
We have a number of custom mypy checks and would like them to have distinct error codes, allowing them to be reported / ignored / enabled / disabled just as built in errors.
mypy appears to mostly support custom error codes defined by a plugin, since the ErrorCode constructor registers with the global collection of errors, and everything operates as expected (reporting, using type: ignore[], and disabling... but see below).
The problem comes up when referring to custom errors codes in options, triggering Invalid error code(s):
on command line with --disable-error-code, etc.: fails outright with non-zero code
in pyproject.toml disable_error_code etc.: outputs a warning but does not cause non-zero exit, and the reference is properly honored
I believe this can be rectified by deferring the error code check until after plugins are loaded, but realize that may be tricky to implement.
Activity
ilevkivskyi commentedon Sep 29, 2025
I think this is essentially a duplicate of #12987