Skip to content

Commit

Permalink
travis: switch to rustfmt-preview for style checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Mar 20, 2018
1 parent 945f2b4 commit 4b0569e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 39 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
- RUSTFLAGS=-Dwarnings
# Versions known to work with pinned nightly.
- CLIPPY_VERSION=0.0.180
- RUSTFMT_VERSION=0.3.6

before_script:
- export PATH=$HOME/.cargo/bin:$PATH
Expand All @@ -23,12 +22,12 @@ before_script:
fi
- |
if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then
rustup component add rustfmt-preview
cargo install-update -i "clippy:$CLIPPY_VERSION"
cargo install-update -i "rustfmt-nightly:$RUSTFMT_VERSION"
fi
script:
- cargo build && cargo test
- |
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff
- cargo build && cargo test
- |
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy
45 changes: 15 additions & 30 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ pub enum Crater {

#[structopt(name = "define-ex", about = "define an experiment")]
DefineEx {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "tc-1")]
tc1: Toolchain,
#[structopt(name = "tc-2")]
tc2: Toolchain,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
#[structopt(name = "tc-1")] tc1: Toolchain,
#[structopt(name = "tc-2")] tc2: Toolchain,
#[structopt(name = "mode", long = "mode",
default_value_raw = "ExMode::BuildAndTest.to_str()",
possible_values_raw = "&[
Expand All @@ -102,8 +99,7 @@ pub enum Crater {

#[structopt(name = "prepare-ex", about = "prepare shared and local data for experiment")]
PrepareEx {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
},

#[structopt(name = "copy-ex", about = "copy all data from one experiment to another")]
Expand All @@ -114,53 +110,42 @@ pub enum Crater {

#[structopt(name = "delete-ex", about = "delete shared data for experiment")]
DeleteEx {
#[structopt(long = "ex", default_value = "default")]
ex: Ex,
#[structopt(long = "ex", default_value = "default")] ex: Ex,
},

#[structopt(name = "delete-all-target-dirs",
about = "delete the cargo target dirs for an experiment")]
DeleteAllTargetDirs {
#[structopt(long = "ex", default_value = "default")]
ex: Ex,
#[structopt(long = "ex", default_value = "default")] ex: Ex,
},

#[structopt(name = "delete-all-results", about = "delete all results for an experiment")]
DeleteAllResults {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
},

#[structopt(name = "delete-result", about = "delete results for a crate from an experiment")]
DeleteResult {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "toolchain", long = "toolchain", short = "t")]
tc: Option<Toolchain>,
#[structopt(name = "crate")]
krate: ExCrate,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
#[structopt(name = "toolchain", long = "toolchain", short = "t")] tc: Option<Toolchain>,
#[structopt(name = "crate")] krate: ExCrate,
},

#[structopt(name = "run", about = "run an experiment, with all toolchains")]
Run {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
},

#[structopt(name = "run-tc", about = "run an experiment, with a single toolchain")]
RunTc {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "toolchain")]
tc: Toolchain,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
#[structopt(name = "toolchain")] tc: Toolchain,
},

#[structopt(name = "gen-report", about = "generate the experiment report")]
GenReport {
#[structopt(name = "experiment", long = "ex", default_value = "default")]
ex: Ex,
#[structopt(name = "destination")]
dest: Dest,
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
#[structopt(name = "destination")] dest: Dest,
},

#[structopt(name = "publish-report", about = "publish the experiment report to S3")]
Expand Down
9 changes: 3 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ static CONFIG_FILE: &'static str = "config.toml";
#[derive(Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct CrateConfig {
#[serde(default = "default_false")]
skip: bool,
#[serde(default = "default_false")]
skip_tests: bool,
#[serde(default = "default_false")]
quiet: bool,
#[serde(default = "default_false")] skip: bool,
#[serde(default = "default_false")] skip_tests: bool,
#[serde(default = "default_false")] quiet: bool,
}

fn default_false() -> bool {
Expand Down

0 comments on commit 4b0569e

Please sign in to comment.