Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
nicholasbishop merged 1 commit into rust-osdev:main from phip1611:rustdoc-private-items
Nov 27, 2022

Conversation

Copy link
Member

@phip1611 phip1611 commented Nov 14, 2022

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

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611 phip1611 force-pushed the rustdoc-private-items branch 2 times, most recently from eb2b94a to a256f06 Compare November 14, 2022 10:41
Copy link
Member

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.

Copy link
Member Author

phip1611 commented Nov 20, 2022
edited
Loading

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.

Copy link
Member

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.

Copy link
Member Author

sounds like a good idea! I'll take care of that

Copy link
Member

I think maybe something got dropped in a rebase? I don't see the code that uses the new flag.

Copy link
Member Author

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.

Copy link
Member

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 😀

Copy link
Member Author

phip1611 commented Nov 27, 2022
edited
Loading

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 😆

nicholasbishop and GabrielMajeri reacted with laugh emoji

We check also the documentation of private items to find linting errors,
such as broken intra-doc links.
@nicholasbishop nicholasbishop merged commit cceedb9 into rust-osdev:main Nov 27, 2022
@phip1611 phip1611 deleted the rustdoc-private-items branch November 27, 2022 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@nicholasbishop nicholasbishop nicholasbishop approved these changes

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /