-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Replace JSONPath with jq
in jsondocck
#143089
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
Draft
fluiderson
wants to merge
21
commits into
rust-lang:master
Choose a base branch
from
fluiderson:rustdoc-types-jq-testsuit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Replace JSONPath with jq
in jsondocck
#143089
fluiderson
wants to merge
21
commits into
rust-lang:master
from
fluiderson:rustdoc-types-jq-testsuit
+630
−812
Conversation
This file contains hidden or 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
it's unnecessary for private crates
the deleted lines are duplicates of the lines 36 & 37
there are no insignificant whitespaces or comments, it's a single line
- directives were collected before processing, but there seems to be nothing preventing them from checking right away - the unified error message style follows the style of short diagnostics from the compiler (almost the same was used on the deleted line 39)
i tried to keep the original code structure, but it's an almost entire rewrite. thankfully, there are more deletions than insertions, i expect jq to be incredibly powerful to supersede previous set of directives. no tests yet, but it seems to be working. i also simplified the `LINE_PATTERN` regex and added a comment for each section. jaq's guts are a bit arcane to me, but it seems to be only related to its setup, a resulted API turned out to be pretty straightforward
The job Click to see the possible cause of the failure (guessed by this bot)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-compiletest
Area: The compiletest test runner
A-rustdoc-json
Area: Rustdoc JSON backend
A-testsuite
Area: The testsuite used to check the correctness of rustc
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an ongoing effort to close #142479. I've decided to take a hard path and rewrite
rustdoc-types
's entire testsuite. I don't think it'll be a good idea to construct a JSONPath-jq
transpiler because it'll look really awkward for new contributors, JSONPath's limitations +jaq
's own quirks may create a lot of questions that even current maintainers would've no answers for without digging intojsondocck
's internals.I expect
jsondocck
to have just 2 directives:jq
andarg
. Thanks tojq
's flexibility, these 2 can do everything that the current directive set can and much more (actually, too much, I left some comments to opt out some dependencies when it'll be possible onjaq
's side). I'm trying to actively utilizejq
's features instead of just blindly rewriting existing assertions, so there should be more deletions than additions.When I'll be done, I'll try to rebase and split my work to make it more easier to review. So far
jsondocck
is already functional, so you can check out how it may look like and give some feedback if you want. I'll commit updated tests folder by folder.