-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Ability to suppress "Generated" lines from cargo doc
#13336
Comments
For myself, I am very cautious when it comes to adding configuration as it increases the combinations of what could fail and balloons documentation, making it harder to find any other piece of related documentation, making it less likely to use any feature, lowering the value gained from those features. In #12859, I was originally going to show only one "Generated" line but was worried about only showing one package and it confusing the user. This is different than For cargo script, I've been considering finding a way to collapse down the amount of output from cargo but that only helps with everything before "Generated". One option might be if we add a trailing "and X other packages" to the "Generated" line? And then in verbose mode, we instead print them all? |
If the status message of
|
Funny you mention that for cargo test because I want to clean up all of that :) |
Which is why I mentioned a few other options (perhaps less straightforward, but not requiring configuration). Perhaps I should just live with the disadvantage of
Probably |
fix(doc): Collapse down Generated statuses without --verbose ### What does this PR try to resolve? This is trying to balance - Overwhelming the user with a lot of paths - Clarity to the user that the one path is representative of the rest clap before: ``` Finished dev [unoptimized + debuginfo] target(s) in 3.81s Generated /home/epage/src/personal/clap/target/doc/clap/index.html Generated /home/epage/src/personal/clap/target/doc/stdio_fixture/index.html Generated /home/epage/src/personal/clap/target/doc/clap_bench/index.html Generated /home/epage/src/personal/clap/target/doc/clap_builder/index.html Generated /home/epage/src/personal/clap/target/doc/clap_complete/index.html Generated /home/epage/src/personal/clap/target/doc/clap_complete_fig/index.html Generated /home/epage/src/personal/clap/target/doc/clap_complete_nushell/index.html Generated /home/epage/src/personal/clap/target/doc/clap_derive/index.html Generated /home/epage/src/personal/clap/target/doc/clap_lex/index.html Generated /home/epage/src/personal/clap/target/doc/clap_mangen/index.html ``` clap after: ``` Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.44s Generated /home/epage/src/personal/clap/target/doc/clap/index.html and 9 other files ``` Fixes #13336 ### How should we test and review this PR? Tests were updated in earlier commits to help show the behavior change ### Additional information
Problem
Since Rust 1.75, when
cargo doc
is run without--open
, it prints "Generated <path>
" for each documented crate in the workspace (#5562). While this is useful when users wish to open the documentation by some other means than--open
, it's clutter (~doubling the height of the output) in a large workspace when the user already has the documentation open or has other means to access the path the documentation will be generated at.Proposed Solution
Add a configuration option which suppresses “Generated” lines.
Alternatively, make
cargo doc
emit only one such line for the entire workspace, in the same way thatcargo doc --open
picks one path; this could be an option or might even be acceptable as the default behavior.Notes
--quiet
is not an adequate solution since it hides all output, including progress when re-documenting dependencies from clean.The reason I personally care about this is that running
cargo doc
is part of my normal development cycle — if I don't run it, I won't discover I've broken an intra-doc link, which happens very often. So, I want the output to be short if nothing is wrong, but still let me see progress. (Ifcargo check
reported broken intra-doc links and other doc lints, that would be an even better alternative, but I don't expect that to be feasible.)The text was updated successfully, but these errors were encountered: