Skip to content

ErrorCodes defined in mypy plugins seemingly cannot be ignored by --disable-error-code #12987

@aleksanb

Description

@aleksanb

It seems like errors registered in plugins are unignoreable by mypy, as in the following case from the django-stubs plugin for mypy for analyzing django code: typeddjango/django-stubs#993.

We have some custom error codes declared like this:

and presumably mypy checks the list of errors here:

valid_error_codes = set(error_codes.keys())
before initializing plugins, so our custom errors haven't ended up in error_codes before we check them.

Any suggestions for workarounds or fixes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-configurationConfiguration files and flagstopic-pluginsThe plugin API and ideas for new plugins

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions