Skip to content

[rustdoc] Correctly handle output options with --show-coverage#159411

Open
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:show-coverage
Open

[rustdoc] Correctly handle output options with --show-coverage#159411
GuillaumeGomez wants to merge 3 commits into
rust-lang:mainfrom
GuillaumeGomez:show-coverage

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes #158929.

The -o option was ignored with --show-coverage. This PR takes it into account and makes it closer to how these options are handled in the rest of rustdoc.

Considering calculate_doc_coverage was never really a pass and that I needed RenderOptions (for the -o option), I moved it out of passes.

r? @camelid

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 16, 2026
@rustbot

rustbot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

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

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Ah, maybe @Urgau then?

r? @Urgau

@rustbot rustbot assigned Urgau and unassigned camelid Jul 16, 2026
@rust-log-analyzer

This comment has been minimized.

@Urgau

Urgau commented Jul 16, 2026

Copy link
Copy Markdown
Member

I haven't looked at the implementation, but it seems a bit weird to me to have an flag called --show-coverage that doesn't show anything when used with -o. Are we worried about confusing users?

#158929 suggests updating the documentation instead.
cc @aDotInTheVoid (in case you have an opinion)

@GuillaumeGomez

Copy link
Copy Markdown
Member Author

I haven't looked at the implementation, but it seems a bit weird to me to have an flag called --show-coverage that doesn't show anything when used with -o. Are we worried about confusing users?

#158929 suggests updating the documentation instead. cc @aDotInTheVoid (in case you have an opinion)

If you want to generate the output in a file, that seems kinda logical to not have output on stdout.

@rust-log-analyzer

This comment has been minimized.

@Urgau

Urgau commented Jul 17, 2026

Copy link
Copy Markdown
Member

If you want to generate the output in a file, that seems kinda logical to not have output on stdout.

100% agree, but the CLI option is called --show-..., that implies (at least to me) -o - (i.e. the current behavior). Maybe we should have --coverage?

Is there a way to know if some users are currently relying on the current behavior? (since this is a breaking change)

@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 17, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

docs.rs. We could rename the option, I don't mind. But something like --doc-coverage seems better than just coverage, no?

@Urgau

Urgau commented Jul 20, 2026

Copy link
Copy Markdown
Member

Yeah, --doc-coverage seems fine. I'm mostly worried about the breaking change to --show-coverage, so if -o is respected only for this new option, that seems fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc: --show-coverage --output-format=json doesn't respect -o, but the docs suggest it will.

5 participants