Skip to content

Commit 4b0569e

Browse files
committed
travis: switch to rustfmt-preview for style checks
1 parent 945f2b4 commit 4b0569e

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ env:
1111
- RUSTFLAGS=-Dwarnings
1212
# Versions known to work with pinned nightly.
1313
- CLIPPY_VERSION=0.0.180
14-
- RUSTFMT_VERSION=0.3.6
1514

1615
before_script:
1716
- export PATH=$HOME/.cargo/bin:$PATH
@@ -23,12 +22,12 @@ before_script:
2322
fi
2423
- |
2524
if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then
25+
rustup component add rustfmt-preview
2626
cargo install-update -i "clippy:$CLIPPY_VERSION"
27-
cargo install-update -i "rustfmt-nightly:$RUSTFMT_VERSION"
2827
fi
2928
script:
30-
- cargo build && cargo test
3129
- |
3230
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff
31+
- cargo build && cargo test
3332
- |
3433
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy

src/cli.rs

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,9 @@ pub enum Crater {
7474

7575
#[structopt(name = "define-ex", about = "define an experiment")]
7676
DefineEx {
77-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
78-
ex: Ex,
79-
#[structopt(name = "tc-1")]
80-
tc1: Toolchain,
81-
#[structopt(name = "tc-2")]
82-
tc2: Toolchain,
77+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
78+
#[structopt(name = "tc-1")] tc1: Toolchain,
79+
#[structopt(name = "tc-2")] tc2: Toolchain,
8380
#[structopt(name = "mode", long = "mode",
8481
default_value_raw = "ExMode::BuildAndTest.to_str()",
8582
possible_values_raw = "&[
@@ -102,8 +99,7 @@ pub enum Crater {
10299

103100
#[structopt(name = "prepare-ex", about = "prepare shared and local data for experiment")]
104101
PrepareEx {
105-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
106-
ex: Ex,
102+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
107103
},
108104

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

115111
#[structopt(name = "delete-ex", about = "delete shared data for experiment")]
116112
DeleteEx {
117-
#[structopt(long = "ex", default_value = "default")]
118-
ex: Ex,
113+
#[structopt(long = "ex", default_value = "default")] ex: Ex,
119114
},
120115

121116
#[structopt(name = "delete-all-target-dirs",
122117
about = "delete the cargo target dirs for an experiment")]
123118
DeleteAllTargetDirs {
124-
#[structopt(long = "ex", default_value = "default")]
125-
ex: Ex,
119+
#[structopt(long = "ex", default_value = "default")] ex: Ex,
126120
},
127121

128122
#[structopt(name = "delete-all-results", about = "delete all results for an experiment")]
129123
DeleteAllResults {
130-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
131-
ex: Ex,
124+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
132125
},
133126

134127
#[structopt(name = "delete-result", about = "delete results for a crate from an experiment")]
135128
DeleteResult {
136-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
137-
ex: Ex,
138-
#[structopt(name = "toolchain", long = "toolchain", short = "t")]
139-
tc: Option<Toolchain>,
140-
#[structopt(name = "crate")]
141-
krate: ExCrate,
129+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
130+
#[structopt(name = "toolchain", long = "toolchain", short = "t")] tc: Option<Toolchain>,
131+
#[structopt(name = "crate")] krate: ExCrate,
142132
},
143133

144134
#[structopt(name = "run", about = "run an experiment, with all toolchains")]
145135
Run {
146-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
147-
ex: Ex,
136+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
148137
},
149138

150139
#[structopt(name = "run-tc", about = "run an experiment, with a single toolchain")]
151140
RunTc {
152-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
153-
ex: Ex,
154-
#[structopt(name = "toolchain")]
155-
tc: Toolchain,
141+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
142+
#[structopt(name = "toolchain")] tc: Toolchain,
156143
},
157144

158145
#[structopt(name = "gen-report", about = "generate the experiment report")]
159146
GenReport {
160-
#[structopt(name = "experiment", long = "ex", default_value = "default")]
161-
ex: Ex,
162-
#[structopt(name = "destination")]
163-
dest: Dest,
147+
#[structopt(name = "experiment", long = "ex", default_value = "default")] ex: Ex,
148+
#[structopt(name = "destination")] dest: Dest,
164149
},
165150

166151
#[structopt(name = "publish-report", about = "publish the experiment report to S3")]

src/config.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ static CONFIG_FILE: &'static str = "config.toml";
99
#[derive(Deserialize)]
1010
#[serde(rename_all = "kebab-case")]
1111
pub struct CrateConfig {
12-
#[serde(default = "default_false")]
13-
skip: bool,
14-
#[serde(default = "default_false")]
15-
skip_tests: bool,
16-
#[serde(default = "default_false")]
17-
quiet: bool,
12+
#[serde(default = "default_false")] skip: bool,
13+
#[serde(default = "default_false")] skip_tests: bool,
14+
#[serde(default = "default_false")] quiet: bool,
1815
}
1916

2017
fn default_false() -> bool {

0 commit comments

Comments
 (0)