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

Replace check_missing_items.py with jsondoclint #101809

Merged
merged 11 commits into from
Sep 16, 2022

Conversation

aDotInTheVoid
Copy link
Member

zulip discussion

check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (jsondoclint) that does the same thing.

Motivation

  1. Easier to change when rustdoc-json-types changes, as jsondoclint uses the types directly.
  2. Better Errors:
    • Multiple Errors can be emited for a single crate
    • Errors can say where in JSON they occored
      2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
      2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
      
  3. Catches more bugs.
  4. Allows the possibility of running from rustdoc::json, which we should do in a crator run at some point.

cc @CraftSpider

r? @GuillaumeGomez

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 14, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 14, 2022
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@CraftSpider CraftSpider left a comment

Choose a reason for hiding this comment

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

This looks amazing to me! Much more maintainable than the old check_missing

@GuillaumeGomez
Copy link
Member

This is a great improvement, thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Sep 15, 2022

📌 Commit f69a6c2 has been approved by GuillaumeGomez

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 Sep 15, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…aumeGomez

Replace `check_missing_items.py` with `jsondoclint`

[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)

check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.

### Motivation

1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
    - Multiple Errors can be emited for a single crate
    - Errors can say where in JSON they occored
        ```
        2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
        2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
        ```
3. Catches more bugs.
    - Because matches are exaustive, all posible variants considered for enums
    - All Id's checked
    - Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973
    - Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.

cc `@CraftSpider`

r? `@GuillaumeGomez`
@Dylan-DPC
Copy link
Member

Dylan-DPC commented Sep 15, 2022

failed in rollup
@bors r-

(or likely shouldnt be rolledup)

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2022
@aDotInTheVoid
Copy link
Member Author

aDotInTheVoid commented Sep 15, 2022

@Dylan-DPC The rollup failure is due to #101783, not this. That PR touched src/bootstrap/configure.py, and added an f-string, that isn't supported in whatever version of python CI uses

@Dylan-DPC
Copy link
Member

@bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Sep 15, 2022

📌 Commit f69a6c2 has been approved by GuillaumeGomez

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 15, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…aumeGomez

Replace `check_missing_items.py` with `jsondoclint`

[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)

check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.

### Motivation

1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
    - Multiple Errors can be emited for a single crate
    - Errors can say where in JSON they occored
        ```
        2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
        2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
        ```
3. Catches more bugs.
    - Because matches are exaustive, all posible variants considered for enums
    - All Id's checked
    - Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973
    - Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.

cc `@CraftSpider`

r? `@GuillaumeGomez`
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#101722 (Rustdoc-Json: Fix Type docs.)
 - rust-lang#101738 (Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`)
 - rust-lang#101753 (Prefer explict closure sig types over expected ones)
 - rust-lang#101787 (cache `collect_trait_impl_trait_tys`)
 - rust-lang#101802 (Constify impl Fn* &(mut) Fn*)
 - rust-lang#101809 (Replace `check_missing_items.py` with `jsondoclint`)
 - rust-lang#101864 (rustdoc: remove no-op CSS `h1-4 { color: --main-color }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 458555d into rust-lang:master Sep 16, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 16, 2022
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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