Skip to content

Add static links for error codes #7186

Closed

Description

@ilevkivskyi

It would be great to provide a link with a bit more detailed explanation for every error code. For example:

main.py:10: error [bad_variance]: Invariant type variable 'T' used in protocol where covariant one is expected
main.py:10: note: See https://mypy-lang.org/error/bad_variance for more details

The the link will give some explanation why this is an error and links to relevant documentation section on Read the Docs. (Such notes may be shown only once for every error code.)

Something similar is used by SQLAlchemy (but their errors use numerical codes), see e.g. http://sqlalche.me/e/f405.

Depends on #6472

Activity

  1. Shivansh-khare commented on Oct 30, 2020

    @Shivansh-khare

    I want to work on this issue. can you tell me where are these errors messages.

  2. JelleZijlstra commented on Oct 31, 2020

    @JelleZijlstra
    Member

    @Shivansh-khare you can grep for them in source code, most of them (maybe all?) appear in messages.py I think.

  3. Shivansh-khare commented on Oct 31, 2020

    @Shivansh-khare

    @JelleZijlstra Can I hard code it with msg variable or add error_note_function for every error msg as done with incompatible_argument function at line:563 .

  4. ilevkivskyi commented on Jun 14, 2023

    @ilevkivskyi
    MemberAuthor

    As a first step we can create consistent links in the docs, see #15435

  5. added a commit that references this issue on Jun 28, 2023
    fca4cae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions