-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: doctest respects Cargo's color options #14425
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
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
6806579 to
1e026c6
Compare
|
Sorry for the problems. I am trying to fix my branch commits |
616fcf9 to
4e62a57
Compare
4e62a57 to
4657015
Compare
|
Hello, please review the latest changes, thank you |
| ColorChoice::Never => "never", | ||
| ColorChoice::CargoAuto => "auto", | ||
| }; | ||
| p.arg("--color").arg(color_arg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to call out that this may break others' builds if they already have --color in their RUSTDOCFLAGS. rustdoc doesn't allow more then one occurrence of the --color flag. While we don't consider this a breaking change, this is worth mentioning in changelog.
|
@bors r+ |
|
☀️ Test successful - checks-actions |
Update cargo 12 commits in ba8b39413c74d08494f94a7542fe79aa636e1661..8f40fc59fb0c8df91c97405785197f3c630304ea 2024-08-16 22:48:57 +0000 to 2024-08-21 22:37:06 +0000 - Tests rely on absence of RUST_BACKTRACE (rust-lang/cargo#14441) - fix: -Cmetadata includes whether extra rustflags is same as host (rust-lang/cargo#14432) - [mdman] Normalize newlines when rendering options (rust-lang/cargo#14428) - fix: doctest respects Cargo's color options (rust-lang/cargo#14425) - Be more permissive while packaging unpublishable crates. (rust-lang/cargo#14408) - fix: Limiting pre-release match semantics to use only on `OptVersionReq::Req` (rust-lang/cargo#14412) - test: add a regression test for Issue 14409 (rust-lang/cargo#14430) - chore: update label trigger for Command-info (rust-lang/cargo#14422) - doc: add lockfile-path unstable doc section (rust-lang/cargo#14423) - doc: update lockfile-path tracking issue (rust-lang/cargo#14424) - fix: remove list owners feature of info subcommand (rust-lang/cargo#14418) - Lockfile path tests (follow-up) (rust-lang/cargo#14417)
What does this PR try to resolve?
Explain the motivation behind this change.
This commit fixes the issue where cargo's test command doesn't respect the color parameter when it gets passed in like this command:
cargo t --color never --doc -- --color neverFixes #14403
How should we test and review this PR?
Test on a basic rust project, with a file called lib.rs that looks like this
You can try to replicate the same commands @zacknewman used in the description of this issue.
cargo t --color never --doc -- --color neverYou will see that compared to the official build of cargo, this build will respect the --color argument