Skip to content

[rustdoc-json] Add tests for #[doc(hidden)] handling of items. #143665

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

obi1kenobi
Copy link
Member

@obi1kenobi obi1kenobi commented Jul 9, 2025

Add tests which check:

  • #[doc(hidden)] items are not present in rustdoc JSON output by default.
  • Invoking rustdoc with --document-hidden-items makes #[doc(hidden)] items appear, and they show their #[doc(hidden)] status appropriately.

r? @aDotInTheVoid

@rustbot
Copy link
Collaborator

rustbot commented Jul 9, 2025

aDotInTheVoid is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jul 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 9, 2025

These commits modify tests/rustdoc-json.
rustdoc-json is a public (but unstable) interface.

Please ensure that if you've changed the output:

  • It's intentional.
  • The FORMAT_VERSION in src/librustdoc-json-types is bumped if necessary.

cc @aDotInTheVoid, @obi1kenobi

@obi1kenobi obi1kenobi force-pushed the pg/doc-hidden-tests branch from 0dfd729 to 083b572 Compare July 9, 2025 02:07
@obi1kenobi
Copy link
Member Author

Removed the HTML test changes, only including the rustdoc JSON tests.

@obi1kenobi obi1kenobi requested a review from fmease July 9, 2025 02:07
@aDotInTheVoid aDotInTheVoid changed the title [rustdoc] Add tests for #[doc(hidden)] handling of items. [rustdoc-json] Add tests for #[doc(hidden)] handling of items. Jul 9, 2025
@aDotInTheVoid
Copy link
Member

Thanks for writing these, really appreciate you doing the not glamours (but very important) work here.

Tests content is good, but I don't think they should live in tests/rustdoc-json/attrs, as they're not really testing the rendering of attributes, but the items we keep and don't. I think they'd be better suited to a (new) tests/rustdoc-json/visibility folder.

Also, could you edit the commit message to make it clear that this is specifically for rustdoc-json.

r=me with those nits addressed.

@bors delegate+

@bors rollup=always

@bors
Copy link
Collaborator

bors commented Jul 9, 2025

✌️ @obi1kenobi, you can now approve this pull request!

If @aDotInTheVoid told you to "r=me" after making some further change, please make that change, then do @bors r=@aDotInTheVoid

@obi1kenobi obi1kenobi force-pushed the pg/doc-hidden-tests branch from 083b572 to 27fb02c Compare July 10, 2025 00:22
@obi1kenobi
Copy link
Member Author

@bors r=aDotInTheVoid

@bors
Copy link
Collaborator

bors commented Jul 10, 2025

📌 Commit 27fb02c has been approved by aDotInTheVoid

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 10, 2025
…aDotInTheVoid

[rustdoc-json] Add tests for `#[doc(hidden)]` handling of items.

Add tests which check:
- `#[doc(hidden)]` items are not present in rustdoc JSON output by default.
- Invoking rustdoc with `--document-hidden-items` makes `#[doc(hidden)]` items appear, and they show their `#[doc(hidden)]` status appropriately.

r? `@aDotInTheVoid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants