-
Notifications
You must be signed in to change notification settings - Fork 62
Add yolo mode to rustfix #26
Conversation
22f2ef0
to
68a18ab
Compare
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.
LGTM modulo one very important code style thing
src/main.rs
Outdated
@@ -92,7 +95,7 @@ fn get_json(extra_args: &[&str]) -> Result<String, ProgramError> { | |||
Ok(String::from_utf8(output.stdout)?) | |||
} | |||
|
|||
fn handle_suggestions(suggestions: &[Suggestion]) -> Result<(), ProgramError> { | |||
fn handle_suggestions(suggestions: &[Suggestion], yolo: bool) -> Result<(), ProgramError> { |
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.
Nope, this is not how we do things. There needs to be an enum Assertiveness { BetterSafeThanSorry, Yolo }
instead of a boring bool
!
I'm really confused about how travis works... |
#[derive(PartialEq, Eq, Debug)] | ||
enum AutofixMode { | ||
/// Do not apply any fixes automatically | ||
None, |
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.
But… but… it took me minutes to come up with BetterSafeThanSorry
😿
Okay… fine. Have it your way.
travis.sh
Outdated
cargo build | ||
if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then | ||
cargo test -- --nocapture | ||
fi |
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.
Can you embed that in .travis.yml
? I don't think these 4 lines need to be in their own file
Err, you probably need to start that file with script:
- |
cargo build &&
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
cargo test -- --nocapture
fi |
Feel free to merge, and maybe squash the travis struggle commits if you want |
… since they need clippy
No description provided.