Repository navigation
x setup: ask if warnings should (not) be denied - #165461
WaffleLapkin wants to merge 4 commits into
Conversation
Move `Profile` into it's own module for clarity, make the `bootstrap.toml` setup step a separate struct (`BootstrapToml`) *containing* `Profile`.
This makes it much clearer which steps use which helper functions, etc.
Previous version was hardcoding yes/print/no/default as the options, which is silly given that it's used in many places where "print" is not *actually* an option. IMO the previous version made it quite confusing... Now it accepts a closure which decides which asnwers are accepted.
|
|
| let deny_warnings = { | ||
| println!( | ||
| "\nRust CI fails when there are any warnings. It is possible to deny warnings locally too, \ | ||
| but that can hurt iteration cycle (forcing you to rebuild everything when there are warnings).\n" | ||
| ); | ||
|
|
||
| prompt_user("Deny warnings? [y/N]", |input| match input { | ||
| "y" => Break(true), | ||
| "n" | "" => Break(false), | ||
| _ => Continue(()), | ||
| }) | ||
| .unwrap() | ||
| }; |
There was a problem hiding this comment.
This makes x setup library/etc be interactive. Is that a problem?
There was a problem hiding this comment.
I don't think so, other setup commands are already interactive, and I assume that it doesn't really make sense to use those commands non-interactively 🤔 If yes, people can just stuff yes into it.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Kobzol
left a comment
There was a problem hiding this comment.
Looks good! Left some comments. GitHub is not allowing me to comment inline atm, so:
I was a bit confused reading the "Rust CI fails when there are any warnings." sentence. The "forces you to rebuild" is a bit misleading, I think. The real problem is that it forces you to fix the warnings before you can get a working compiler build, right?
| let rust_section = if deny_warnings { "" } else { "\n[rust]\ndeny-warnings = false\n" }; | ||
|
|
||
| let settings = format!( | ||
| "# See bootstrap.example.toml for documentation of available options\n\ |
There was a problem hiding this comment.
Could we just use raw strings (r#"..."#) here and in rust_section? 😆 It would be much more readable.
Alternative to #124439 that I feel easier about.
Refactors how we handle
x setupand adds a question about denying warnings.r? @Kobzol