-
Notifications
You must be signed in to change notification settings - Fork 681
Add links to docs in default results output #2978
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
Comments
I found these snippets: https://psalm.dev/r/34544e24dd<?php
$rows = (array) $_GET['rows'];
$entities = [];
foreach ($rows as $row) {
$entities['string'][] = 'string';
}
foreach ($entities['string'] as $string) {
takesBool($string);
}
function takesBool(bool $b) : void {}
|
I think we should provide a link to issue description in the Psalm output (something like https://psalm.dev/issue/MixedAssignment). This will both be easier for users (you don't have to google it, just click the link) and will push those pages higher in google rankings because people will post their Psalm output containing the links. |
Yeah – but that could also make the output a little noisy, unless the urls were shortened e.g.
|
Sorbet does this: https://sorbet.run |
I would try to truncate non-essential parts of the URL, but keep the domain and issue name fully spelled out:
c.f.
Scheme, however, may need to be kept to make URLs clickable in the terminal output. |
If you use a shorter version of the URL, my understanding is that you should definitely set the canonical link in the page with:
as otherwise you might 'dilute' the page ranking. |
btw one other improvement that could be made (and I realise this is significant chunk of work, and me volunteering other people to do a lot of work is annoying), is showing what the fix would be in the example for each issue type. For example, the current doc for the MixedAssignment error is:
I'm a bit of a newb when it comes to Psalm. I'm sure it'll get easier for me to understand how to apply types to fix these errors, but right now my confidence in me being able to fix this error in less than five attempts is pretty low. If as well as the code showing the example error, there was example code with the appropriate type info added, I think this would make it easier to go from an error to fixing the issue for psalm users. |
If I created |
I've just added this: f22f5e3 For more in the same vein you can edit this: https://github.com/vimeo/psalm/edit/master/docs/running_psalm/issues.md |
But to the broader point, do you think each issue deserves its own page? |
I'm leaning on the side of 'yes'. |
Lovely. One thing that might help ux a little is either a link back to the list of issue types, or if it's possible the list on that page also. |
Yeah – adding a breadcrumb would be cool. In the meantime, see https://psalm.dev/032 |
Thank you. |
Trying to find the docs for some errors is harder than ideal, as examples are showing up in preference to the docs.
e.g. Searching for php psalm MixedAssignment does not include the Psalm docs in the first results, but does include multiple example snippets like: https://psalm.dev/r/34544e24dd
I needed to explicitly search under the docs directory with "MixedAssignment site:https://psalm.dev/docs/" to be able to find the docs.
Any way to improve the discoverability of the docs would be great.
I guess either by excluding the examples from googles indexing, or possibly chucking them under a different sub-domain (, as it could be possible that google is ranking them so highly as they are on the same domain as the main site) would be possible improvements.
The text was updated successfully, but these errors were encountered: