-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error output from rustdoc is stripped of color #326
Comments
Interestingly, this works fine when I pass |
Thanks for the two bug reports, much appreciated! I also suspect "cargo doesn't think it's printing to a terminal" as the cause. Will look into it! |
I've looked into it a bit more: Depending on whether we want silenced output or not (so whether we use e.g. cargo-semver-checks/src/rustdoc_cmd.rs Line 57 in 135cb33
cargo doc sees that it's being piped and disables colors. An easy solution would be to pass --color=always to the cargo doc command (I've checked it and it works), or we could somehow try to capture the output in some other ways.
Is is OK to use |
You can use |
I've implemented the suggestion in #360. |
This will be out in the next release, ETA ~half an hour or so. |
Steps to reproduce the bug with the above code
cargo new --lib example
)echo x > src/lib.rs
)cargo semver-checks check-release
Actual Behaviour
The errors are printed without color:
Expected Behaviour
The errors are printed with color, just like
cargo doc
:Generated System Information
Software version
cargo-semver-checks 0.16.2
Operating system
macOS 13.1 (Darwin 22.2.0)
Command-line
cargo version
Compile time information
Build Configuration
Additional Context
I see that you're passing
--json=diagnostic-rendered-ansi
, so I'm not sure where the color stripping happens. Maybe cargo doesn't think it's being output to a terminal and you need to pass--color
explicitly?The text was updated successfully, but these errors were encountered: