-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking issue for rustdoc --output-format=doctest
command-line flag
#134529
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
Comments
Thanks a lot! @rustbot label A-rust-for-linux |
…=notriddle,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of rust-lang#134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](Rust-for-Linux/linux#2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
Rollup merge of rust-lang#134531 - GuillaumeGomez:extract-doctests, r=notriddle,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of rust-lang#134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](Rust-for-Linux/linux#2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
…e,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of rust-lang/rust#134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](Rust-for-Linux/linux#2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
…e,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of rust-lang/rust#134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](Rust-for-Linux/linux#2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
--extract-doctests
command-line flag--output-format=doctest
command-line flag
…iddle rustdoc-book: Clean up section on `--output-format` Followup to rust-lang#134531. Tracking issues rust-lang#76578 and rust-lang#134529 I guess. r? `@GuillaumeGomez`
…iddle rustdoc-book: Clean up section on `--output-format` Followup to rust-lang#134531. Tracking issues rust-lang#76578 and rust-lang#134529 I guess. r? ``@GuillaumeGomez``
Rollup merge of rust-lang#136405 - aDotInTheVoid:unstable-doc, r=notriddle rustdoc-book: Clean up section on `--output-format` Followup to rust-lang#134531. Tracking issues rust-lang#76578 and rust-lang#134529 I guess. r? ``@GuillaumeGomez``
…e,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of rust-lang/rust#134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](Rust-for-Linux/linux#2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
Starting to play with this to see how we can use this in Cargo. If I'm understanding correctly, doctests are not scraped from re-exported APIs. Does that mean I can run In that case, is there a way we can prevent the compile errors from showing up and have the rustdoc process return success?
It looks like What are your thoughts on using jsonlines, like As for message content:
|
The doctests are still extracted from compiler information, which might include dependencies (because if you inline a foreign item, then you need to get its attributes).
Sounds like a bug, please open an issue. :)
In most cases it should be possible. If it's generated from a (proc-)macro, it becomes a bit tricky, we can add a
Can't find it but I remember there was an issue about adding the possibility to name a doctest.
I suppose so.
Terrible naming and no docs, I'm ashamed. So:
Not sure to understand what you mean there. Please open issues for bug and requested features and add details for the last point. :) |
This option is needed by the Rust-for-Linux project. The goal is to allow them to extract doctests so they can modify them and run them however they want to simplify their testing pipeline.
Steps
--output-format=doctest
command-line flag #134531)Unresolved Questions
None currently.
The text was updated successfully, but these errors were encountered: