Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Add yolo mode to rustfix #26

Merged
merged 2 commits into from
May 16, 2017
Merged

Add yolo mode to rustfix #26

merged 2 commits into from
May 16, 2017

Conversation

oli-obk
Copy link
Collaborator

@oli-obk oli-obk commented May 15, 2017

No description provided.

@oli-obk oli-obk force-pushed the master branch 2 times, most recently from 22f2ef0 to 68a18ab Compare May 15, 2017 12:39
Copy link
Member

@killercup killercup left a 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> {
Copy link
Member

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! :trollface:

@oli-obk
Copy link
Collaborator Author

oli-obk commented May 15, 2017

I'm really confused about how travis works...

#[derive(PartialEq, Eq, Debug)]
enum AutofixMode {
/// Do not apply any fixes automatically
None,
Copy link
Member

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
Copy link
Member

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

@killercup
Copy link
Member

travis.sh: 2: [: nightly: unexpected operator

Err, you probably need to start that file with #! /bin/sh. But, seriously, add this to the travis yaml instead

script:
- |
  cargo build &&
  if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
    cargo test -- --nocapture
  fi

@killercup
Copy link
Member

Feel free to merge, and maybe squash the travis struggle commits if you want

@oli-obk oli-obk merged commit f2ebd18 into rust-lang:master May 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants