[ty] Link to Callable __name__ FAQ directly from unresolved-attribute diagnostic#22437
[ty] Link to Callable __name__ FAQ directly from unresolved-attribute diagnostic#22437AlexWaygood merged 2 commits intomainfrom
Callable __name__ FAQ directly from unresolved-attribute diagnostic#22437Conversation
…ibute` diagnostic
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
| <https://docs.astral.sh/ty/reference/typing-faq/\ | ||
| #why-does-ty-say-callable-has-no-attribute-__name__>", |
There was a problem hiding this comment.
How does this render on a terminal? Do we need to wrap the url in <>?
There was a problem hiding this comment.
How does this render on a terminal?
like this:
Do we need to wrap the url in
<>?
Yes (as I've done) -- without the <> around the URL, if I double click on the URL in the terminal it tries to load https://docs.astral.sh/ty/reference/typing-faq/#why-does-ty-say-callable-has-no-attribute-__name (without the __ suffix at the end of the URL). That doesn't exist, so the page loaded in the browser opens at the top of the FAQs page
MichaReiser
left a comment
There was a problem hiding this comment.
My only concern with this is that it adds more URLs that we add more dependencies on how our docs are structured.
yeah, definitely a downside. It seems far more user-friendly to link to the FAQ directly to the diagnostic, though, and not a huge maintenance burden for us. If a user notices that the link in the diagnostic goes stale, it's very trivial for us to update it in a PR. |
But that only works for new ty versions ;) What we do for Ruff is maintain URL stability and that's not a lot of work but requires extra care |
Summary
I think this would have helped with astral-sh/ty#2375
Test Plan
Snapshots updated