-
-
Notifications
You must be signed in to change notification settings - Fork 178
doc: add '--document-private-items' to cargo xtask doc
#569
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
doc: add '--document-private-items' to cargo xtask doc
#569
Conversation
eb2b94a
to
a256f06
Compare
Can you say more about why you want this extra check? I intentionally don't use intra-doc links in the docstrings of private items because no one is going to see them rendered as links anyway, so I think this might not be necessary.
Can you say more about why you want this extra check?
Usually, I always write/use intra-doc links when I document my code. I do not always have in mind whether the documentation will be public or not.
OK, in that case how about adding a --document-private-items
flag to cargo xtask doc
, so this change can be optional. (I would like the default output of cargo xtask doc
to be similar to docs.rs since some areas can be quite cluttered with private stuff enabled -- see BootServices
for example.) We can enable the flag in the CI so that it is always checked before merging.
sounds like a good idea! I'll take care of that
a256f06
to
cda0221
Compare
I think maybe something got dropped in a rebase? I don't see the code that uses the new flag.
I think maybe something got dropped in a rebase? I don't see the code that uses the new flag.
No, it should be fine. Luckily, we do not have code yet that breaks the lint.
cda0221
to
d6ba1cc
Compare
But don't we need a change in xtask/src/cargo.rs
to actually pass --document-private-items
to cargo doc
? Right now you can pass the flag to cargo xtask doc
but it doesn't do anything. Unless I'm totally missing something. I am on Amtrak internet right now which feels like 1990s dialup, so github is loading very slowly 😀
d6ba1cc
to
56ca33a
Compare
Oh, I'm sorry 🙈 You are totally right. No idea how I missed that. Should be fine now? @nicholasbishop
I am on Amtrak internet right now which feels like 1990s dialup, so github is loading very slowly
Believe it or not, but it's 99% oft the time the same with mobile internet in trains in Germany 😆
We check also the documentation of private items to find linting errors, such as broken intra-doc links.
56ca33a
to
26e3911
Compare
We do not publicly do this on docs.rs but having
--document-private-items
helps us to prevent illegal intra-doc links and other rustdoc errors in the documentation of private items.Checklist