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

Fully document rustdoc-json-types #127290

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

its-the-shrimp
Copy link
Contributor

100% of rustdoc-json-types is now documented
Here's the summary from rustdoc with -Zunstable-options --show-coverage:

+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/rustdoc-json-types/lib.rs       |        314 |     100.0% |         23 |      31.9% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |        314 |     100.0% |         23 |      31.9% |
+-------------------------------------+------------+------------+------------+------------+

@rustbot
Copy link
Collaborator

rustbot commented Jul 3, 2024

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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. labels Jul 3, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 3, 2024

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi

@its-the-shrimp
Copy link
Contributor Author

r? @aDotInTheVoid

@rustbot rustbot assigned aDotInTheVoid and unassigned fmease Jul 3, 2024
@rust-log-analyzer

This comment has been minimized.

@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from d68cac0 to 662f4e5 Compare July 3, 2024 21:35
@bors
Copy link
Contributor

bors commented Jul 4, 2024

☔ The latest upstream changes (presumably #127305) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link

@aDootInTheVoid aDootInTheVoid left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Unfortunately, it needs a lot of changes before it's suitable to merge.

I've left a comment for all the major categories of issue, but not for each instance as that got unwieldy. When they've all been fixed, please mark this as ready, and I'll take another look at it.

@rustbot author

src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
@rustbot rustbot 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 6, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Jul 6, 2024
@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from 4624360 to 83d3158 Compare July 6, 2024 19:56
@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits (since this message was last posted):

@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from 83d3158 to 15fef33 Compare July 6, 2024 20:23
@rustbot rustbot removed the has-merge-commits PR has merge commits, merge with caution. label Jul 6, 2024
@its-the-shrimp
Copy link
Contributor Author

@rustbot review

I'm not sure about my wording for FORMAT_VERSION though, but I am sure that we should elaborate a bit on what does it actually convey, are there ways to improve?

@rustbot rustbot 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 Jul 6, 2024
@bors
Copy link
Contributor

bors commented Jul 13, 2024

☔ The latest upstream changes (presumably #127665) made this pull request unmergeable. Please resolve the merge conflicts.

@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from 29371be to 4980bf3 Compare July 20, 2024 12:54
Copy link

@aDootInTheVoid aDootInTheVoid left a comment

Choose a reason for hiding this comment

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

This is alot closer, thanks for working on it.

src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
pub synthetic: bool,
/// The name of the generic parameter used for the blanket impl, if this impl was produced by
/// one. For example, for `impl<T, U> Into<U> for T` this field would be `"T"`.

Choose a reason for hiding this comment

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

How is this different from for_?

Choose a reason for hiding this comment

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

As discussed here, I'm happy to leave this to a follup-up, as long as a FIXME comment is added to improve the situation here.

src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/lib.rs Outdated Show resolved Hide resolved
@aDootInTheVoid
Copy link

@rustbot author

@rustbot rustbot 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 22, 2024
@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from 28b790b to 5ac2f69 Compare July 27, 2024 23:07
@its-the-shrimp
Copy link
Contributor Author

@rustbot review

@rustbot rustbot 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 Jul 28, 2024
Copy link

@aDootInTheVoid aDootInTheVoid left a comment

Choose a reason for hiding this comment

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

@rustbot author

pub synthetic: bool,
/// The name of the generic parameter used for the blanket impl, if this impl was produced by
/// one. For example, for `impl<T, U> Into<U> for T` this field would be `"T"`.

Choose a reason for hiding this comment

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

As discussed here, I'm happy to leave this to a follup-up, as long as a FIXME comment is added to improve the situation here.

#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Type {
/// Structs, enums, and unions
/// Structs, enums, unions, etc., e.g. `std::option::Option<u32>`

Choose a reason for hiding this comment

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

It's better to exaustive here. This code:

pub fn is_type(self) -> bool {
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::TypeAlias)
}

controls the things we expect to find here. If you remove Kind::TypeAlias you can see where it appears here

Generic(String),
/// Built in numeric (i*, u*, f*) types, bool, and char
/// Built-in types, such as the integers, floating-point numbers, `bool`, and `char`.

Choose a reason for hiding this comment

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

The problems is you suggest that all built-in types are documented as Type::Primitive, when this isn't the case. I.E. there are built-in types that arn't primitives (e.g. (i32, i32) and &'static str

@rustbot rustbot 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 28, 2024
@its-the-shrimp
Copy link
Contributor Author

@rustbot review

@rustbot rustbot 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 Jul 28, 2024
@aDotInTheVoid
Copy link
Member

This looks good to merge now. If you're able, you should squash the commits, as they arn't logically separate, and it makes tracking the format evolution easier.

r=me with commits squashed.

Thanks again for working on this, and sticking through the many rounds of review.

@its-the-shrimp its-the-shrimp force-pushed the document_rustdoc_json_types branch from 537295d to c881f72 Compare July 28, 2024 23:56
@aDotInTheVoid
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 29, 2024

📌 Commit c881f72 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 29, 2024
@obi1kenobi
Copy link
Member

Nicely done, this is a major improvement and I love it!

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#109174 (Replace `io::Cursor::{remaining_slice, is_empty}`)
 - rust-lang#127290 (Fully document `rustdoc-json-types`)
 - rust-lang#128055 (std: unsafe-wrap personality::dwarf::eh)
 - rust-lang#128269 (improve cargo invocations on bootstrap)
 - rust-lang#128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs)

Failed merges:

 - rust-lang#127543 (More unsafe attr verification)
 - rust-lang#128182 (handle no_std targets on std builds)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 47b76d8 into rust-lang:master Jul 29, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 29, 2024
Rollup merge of rust-lang#127290 - its-the-shrimp:document_rustdoc_json_types, r=aDotInTheVoid

Fully document `rustdoc-json-types`

100% of `rustdoc-json-types` is now documented
Here's the summary from rustdoc with `-Zunstable-options --show-coverage`:

```
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| src/rustdoc-json-types/lib.rs       |        314 |     100.0% |         23 |      31.9% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |        314 |     100.0% |         23 |      31.9% |
+-------------------------------------+------------+------------+------------+------------+
```
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants