forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#101809 - aDotInTheVoid:jsondoclint, r=Guill…
…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`
- Loading branch information
Showing
15 changed files
with
816 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(extern_types)] | ||
|
||
extern { | ||
/// No inner information | ||
pub type Foo; | ||
} | ||
|
||
// @is "$.index[*][?(@.docs=='No inner information')].name" '"Foo"' | ||
// @is "$.index[*][?(@.docs=='No inner information')].kind" '"foreign_type"' | ||
// @!has "$.index[*][?(@.docs=='No inner information')].inner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "jsondoclint" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0.62" | ||
fs-err = "2.8.1" | ||
rustdoc-json-types = { version = "0.1.0", path = "../../rustdoc-json-types" } | ||
serde_json = "1.0.85" |
Oops, something went wrong.