Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static links for error codes #7186

Closed
ilevkivskyi opened this issue Jul 9, 2019 · 4 comments · Fixed by #15449
Closed

Add static links for error codes #7186

ilevkivskyi opened this issue Jul 9, 2019 · 4 comments · Fixed by #15449

Comments

@ilevkivskyi
Copy link
Member

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

@Shivansh-khare
Copy link

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

@JelleZijlstra
Copy link
Member

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

@Shivansh-khare
Copy link

@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 .

@ilevkivskyi
Copy link
Member Author

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

ilevkivskyi added a commit that referenced this issue Jun 28, 2023
Fixes #7186

We can probably add some kind of redirect from mypy-lang.org, but I
think RTD link is already OK. This PR will need to wait until next
release, unless we want to use `/latest` in the link.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants