-
Notifications
You must be signed in to change notification settings - Fork 212
Add doc coverage information #939
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
Conversation
fd30a5f
to
eab41d0
Compare
Not sure to understand the issue with clippy here:
|
eab41d0
to
704a63b
Compare
Looks like a false-positive from the lint. |
And I think I forgot to add something in the migration tests, but not sure what exactly... |
0125a40
to
5114942
Compare
Updated! |
5114942
to
b533389
Compare
Updated! I updated the screenshot as well. |
This says '50 out of 52 items documented' in the screenshot - does it have a subpage that shows which items are documented and which aren't? And if not, could you add that? Maybe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general approach seems good :)
587b863
to
f75d0fe
Compare
7134352
to
1b7cf69
Compare
1b7cf69
to
d5bc7c1
Compare
Updated! I also added it into the "popup" as @jyn514 said. :) Screenshots updated. |
6eedfc2
to
b13ef25
Compare
Blocked on rustwide publishing a new version. |
Pushed two commits to this branch, bumping rustwide to 0.10.0 and removing the macro. |
🎊 |
Hey @GuillaumeGomez, thanks for taking the time to add this feature. :) I was wondering if we could move the Coverage section to a metrics page or something? I'm not sure if it makes sense to display this so prominently in the crate information dropdown. Documentation coverage is a great thing to know, but it doesn't indicate the quality of the crate or even the quality of its documentation. (It has the same downsides as using code coverage as the only metric for how good your tests are.) I think having access to this information is good for library authors, but we should really find a proper place for it where we can make sure it's as useful as possible. If we have a separate page or tab or something, we can keep adding more things to it to help library authors while avoiding overpopulating the crate information dropdown. I think it's great that you added it to the Crate tab as well as the dropdown. Maybe we could remove it from the dropdown for the timebeing while we figure out how to best go about displaying this information? :) |
Thanks for the feedback @sunjay! For now, the feature itself is pretty limited, and we agree: in some cases, the doc coverage isn't an important information (pure FFI bindings for examples). However, for everything else, we've been trying in the documentation team to enforce people to document all items by adding lints ( For now it's only about how many items are documented, but I intend to modify this value by also adding more checks like "how much doc comments are actually providing examples". So this is just a first step, and I am curious to see how it'll be used by users. The "hidden" goal being to force people to document more of course. :3 |
I agree with this goal but not the approach. This feels like negative re-enforcement to me and I think this will have negative impacts on maintainers emotionally when they're being guilt-tripped into adding docs. I'm not sure it should be removed but I think you should tread carefully here and be sure you've considered the emotional impact of this change. |
I wanted to add this information in the crate results directly, but for now I think it's too early for that and that we should let maintainers get to know how it works before putting everything in place. For now, I think the display is quite discrete: when browsing through docs.rs, it's "rare" to take a look at those places, which is why we think it's fine for the moment. The goal isn't to shame anyone for their work. Everyone should be thankful for the incredible work of all rustaceans. We're just trying to help the crate maintainers by giving them tools to improve their crate even more, and to users to help them to have a crate that matches what they need better. Some crates are not meant to be used by "external" users, which is perfectly fine, but in this case, it's "normal" (still think it's a good thing to have documentation in any case, if not others at least for yourself :p) to have less documentation and it's a good indicator that this crate might not be the one you want. However, once again: we didn't promote this display more specifically because we want to help people understand and adjust to the system. It'll also allow us to provide even more information and tools for both crate's owners and users. |
@pietroalbini Might be a bit hard to get what it's talking about, no? Not really sure... However, maybe we could move the documentation coverage block under "dependencies" and "versions" blocks. What do you think? |
I looked more carefully and you're right, I had mistakenly assumed it was in the sidebar on the landing page for the crate docs when you navigate to something like |
We can add it later on, but for now (and the next months in fact...) it's not scheduled. Next step will be to provide a page to help crates' maintainers to understand how this score is computed. |
@GuillaumeGomez tried moving it at the bottom and making the text more clear: |
But still not keeping what the number is about? :p |
I don't think the exact number of items documented is that important. We can make that field a link to the about page though, which already shows the detailed data. |
Saying what it is seems quite important from my point of view. But as you prefer... |
Opened #961 with my proposed change |
This PR adds the usage of the
--show-coverage
option of rustdoc. It currently looks like this:A few things I think remains to be done (to be debated for some of them I guess?):