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
In microsoft/vscode-mypy#58, I'm adding the functionality to link to specific mypy error code documentation. However, there's two issues affecting maintainability:
I would prefer if it was possible to programmatically link to mypy error codes documentation with only the information given by the mypy/dmypy CLI. Redirection is an acceptable solution to me.
Yes, if our error codes pages had custom anchors instead of the autogenerated one, it'd help.
Random thought - perhaps there's a Sphinx extension, or one could be easily built, to redirect anchors (which should be unique within the docs) to the right page / anchor?
OK, I guess I actually broke the readthedocs build. Everything works locally and in CI because mypy is available there, but likely not available in readthedocs build env. I will submit a follow-up PR to only verify the error code completeness in tests.
Activity
Avasam commentedon Jun 13, 2023
FWIW, if I can get the "Error codes enabled by default" from the mypy CLI, that solves the first point.
The second one should be solvable with custom RST anchors. https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html#use-a-custom-anchor
ikonst commentedon Jun 13, 2023
Yes, if our error codes pages had custom anchors instead of the autogenerated one, it'd help.
Random thought - perhaps there's a Sphinx extension, or one could be easily built, to redirect anchors (which should be unique within the docs) to the right page / anchor?
docs: ref redirector (#15432)
ilevkivskyi commentedon Jun 14, 2023
Note btw there is also #7186 I think it is a good idea to add direct short links. I am quite sure we can write a Sphinx extension for this.
ilevkivskyi commentedon Jun 14, 2023
OK, so here is the proposed fix #15435
Use consistent anchors for error codes (#15435)
Avasam commentedon Jun 14, 2023
I missed that. This is basically a duplicate. I'm essentially asking for the same thing.
ilevkivskyi commentedon Jun 14, 2023
OK, I guess I actually broke the readthedocs build. Everything works locally and in CI because
mypyis available there, but likely not available in readthedocs build env. I will submit a follow-up PR to only verify the error code completeness in tests.ilevkivskyi commentedon Jun 14, 2023
#15437 should fix the build.
ilevkivskyi commentedon Jun 14, 2023
OK, this is now available in latest: https://mypy.readthedocs.io/en/latest/_refs.html#code-union-attr
docs: ref redirector (#15432)
Use consistent anchors for error codes (#15435)