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

Clean up mess for --show-coverage documentation #90438

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

GuillaumeGomez
Copy link
Member

It was somewhat duplicated for some reasons... Anyway, this remove this duplication and clean up a bit.

r? @camelid

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Oct 31, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 31, 2021
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the docs for --show-coverage earlier on the page are clearer and more comprehensive than the docs near the end of the page. Can you keep the earlier docs and get rid of the later docs instead?

@camelid camelid 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 Nov 1, 2021
@GuillaumeGomez GuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 8, 2021
@GuillaumeGomez
Copy link
Member Author

Updated!

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with these comments fixed

Comment on lines -450 to -457
$ rustdoc src/lib.rs -Z unstable-options --show-coverage
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| lib.rs | 4 | 100.0% | 1 | 25.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 4 | 100.0% | 1 | 25.0% |
+-------------------------------------+------------+------------+------------+------------+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep this example and put it in the merged section?

Comment on lines -467 to -475
Calculating code examples follows these rules:

1. These items aren't accounted by default:
* struct/union field
* enum variant
* constant
* static
* typedef
2. If one of the previously listed items has a code example, then it'll be counted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like there's corresponding docs in the new section about this? Maybe move this part to the new section as well?

[`--show-coverage`](https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#--show-coverage-get-statistics-about-code-documentation-coverage),
passing `--output-format json` will display the coverage information in JSON format. For example,
here is the JSON for a file with one documented item and one undocumented item:
When using `--output-format json` with this option, it will display the coverage information in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using `--output-format json` with this option, it will display the coverage information in
#### JSON output
When using `--output-format json` with this option, it will display the coverage information in

[JSON format](https://github.com/rust-lang/rfcs/pull/2963). `--output-format html` has no effect,
and is also accepted on stable toolchains.

It can also be used with `--show-coverage`. Take a look at its
[documentation](https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#--show-coverage-get-statistics-about-code-documentation-coverage) for more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[documentation](https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#--show-coverage-get-statistics-about-code-documentation-coverage) for more
[documentation](#--show-coverage-get-statistics-about-code-documentation-coverage) for more

@camelid camelid 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 Nov 17, 2021
@GuillaumeGomez
Copy link
Member Author

Updated!

@bors: r=camelid rollup

@bors
Copy link
Contributor

bors commented Nov 18, 2021

📌 Commit 530eaa8 has been approved by camelid

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 18, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 18, 2021
…=camelid

Clean up mess for --show-coverage documentation

It was somewhat duplicated for some reasons... Anyway, this remove this duplication and clean up a bit.

r? `@camelid`
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 18, 2021
…=camelid

Clean up mess for --show-coverage documentation

It was somewhat duplicated for some reasons... Anyway, this remove this duplication and clean up a bit.

r? ``@camelid``
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2021
Rollup of 8 pull requests

Successful merges:

 - rust-lang#90386 (Add `-Zassert-incr-state` to assert state of incremental cache)
 - rust-lang#90438 (Clean up mess for --show-coverage documentation)
 - rust-lang#90480 (Mention `Vec::remove` in `Vec::swap_remove`'s docs)
 - rust-lang#90607 (Make slice->str conversion and related functions `const`)
 - rust-lang#90750 (rustdoc: Replace where-bounded Clean impl with simple function)
 - rust-lang#90895 (require full validity when determining the discriminant of a value)
 - rust-lang#90989 (Avoid suggesting literal formatting that turns into member access)
 - rust-lang#91002 (rustc: Remove `#[rustc_synthetic]`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 153e4dc into rust-lang:master Nov 18, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 18, 2021
@GuillaumeGomez GuillaumeGomez deleted the doc-show-coverage branch November 19, 2021 08:57
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
…ty-line, r=camelid

Put back removed empty line

Fixes comment from rust-lang#90438 (comment).

r? `@camelid`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
…ty-line, r=camelid

Put back removed empty line

Fixes comment from rust-lang#90438 (comment).

r? ``@camelid``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 19, 2021
…ty-line, r=camelid

Put back removed empty line

Fixes comment from rust-lang#90438 (comment).

r? ```@camelid```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 20, 2021
…ty-line, r=camelid

Put back removed empty line

Fixes comment from rust-lang#90438 (comment).

r? ````@camelid````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants