Skip to content
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

Turn on --document-private-items in CI cargo doc run? #12372

Open
carljm opened this issue Jul 17, 2024 · 2 comments
Open

Turn on --document-private-items in CI cargo doc run? #12372

carljm opened this issue Jul 17, 2024 · 2 comments
Labels
ci Related to internal CI tooling internal An internal refactor or improvement

Comments

@carljm
Copy link
Contributor

carljm commented Jul 17, 2024

If you don't use --document-private-items, then cargo doc won't do anything with doc comments in private modules or on private items; they can have all kinds of issues (e.g. link to nonexistent things) and CI won't catch it.

Given that our public docs use mkdocs, and our rustdoc comments are for our own internal maintenance use, not for documenting a public API, it might make more sense to have our CI use --document-private-items?

This will require a bit of work to clean up a bunch of existing problems in non-public doc comments that were never caught because we don't use --document-private-items.

One thing worth noting: even with --document-private-items, it's still a warning (which for our CI run means an error, since we set RUSTDOCFLAGS='-D warnings') for a public item's docs to link to a private item. I think this is a good thing.

@carljm carljm changed the title Turn on --document-private-items and deny warnings in CI cargo doc run? Turn on --document-private-items in CI cargo doc run? Jul 17, 2024
@carljm carljm added internal An internal refactor or improvement ci Related to internal CI tooling labels Jul 17, 2024
@carljm
Copy link
Contributor Author

carljm commented Jul 17, 2024

cc @MichaReiser @BurntSushi for opinions here

@BurntSushi
Copy link
Member

Just to make sure I understand here, this is just about a CI run that does a check that cargo doc --document-private-items actually works? I don't think I have a strong opinion on that personally, and your reasoning seems good to me. I very rarely use that flag though, so I don't have a ton of experience with it.

carljm added a commit that referenced this issue Aug 12, 2024
Make `cargo doc -p red_knot_python_semantic --document-private-items`
run warning-free. I'd still like to do this for all of ruff and start
enforcing it in CI (#12372) but
haven't gotten to it yet. But in the meantime I'm trying to maintain it
for at least `red_knot_python_semantic`, as it helps to ensure our doc
comments stay up to date.

A few of the comments I just removed or shortened, as their continued
relevance wasn't clear to me; please object in review if you think some
of them are important to keep!

Also remove a no-longer-needed `allow` attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to internal CI tooling internal An internal refactor or improvement
Projects
None yet
Development

No branches or pull requests

2 participants