From 657c85a8c1dd593104214cd490205ced1abbe66b Mon Sep 17 00:00:00 2001 From: Chaya Danzinger Date: Sat, 15 Dec 2018 14:31:16 -0500 Subject: [PATCH 1/4] add rustfmt enforcements to travis.yml --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index f273fbf..7f4919c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,13 @@ cache: - /home/travis/.cargo before_script: - if [[ "$TRAVIS_RUST_VERSION" == "stable" || "$TRAVIS_RUST_VERSION" == "nightly" ]]; then rustup component add clippy-preview; fi + - rustup component add rustfmt script: - if [[ "$TRAVIS_RUST_VERSION" == "stable" || "$TRAVIS_RUST_VERSION" == "nightly" ]]; then cargo clippy --all-targets --all-features -- -D warnings; fi + - cargo fmt --all --write-mode diff + - cargo build - cargo test --verbose + matrix: allow_failures: - rust: nightly From 887a64f241a46b75542f87e404259fbc44e22efa Mon Sep 17 00:00:00 2001 From: Chaya Danzinger Date: Mon, 31 Dec 2018 12:46:48 -0500 Subject: [PATCH 2/4] add rustfmt steps to linux-beta and windows-beta, print version number for rustfmt (issue 32) --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5733f01..a74483a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ matrix: before_script: - rustup component add clippy-preview - rustup component add rustfmt + - rustfmt --version script: - cargo clippy --all-targets --all-features -- -D warnings - cargo fmt --all -- --check @@ -50,7 +51,11 @@ matrix: - name: Linux-Beta env: TARGET=x86_64-unknown-linux-gnu rust: beta + before_script: + - rustup component add rustfmt + - rustfmt --version script: + - cargo fmt --all -- --check - cargo test --verbose - cargo build --verbose @@ -60,6 +65,7 @@ matrix: before_script: - rustup component add clippy-preview - rustup component add rustfmt + - rustfmt --version script: - cargo clippy --all-targets --all-features -- -D warnings - cargo fmt --all -- --check @@ -73,6 +79,7 @@ matrix: before_script: - rustup component add clippy-preview - rustup component add rustfmt + - rustfmt --version script: - cargo clippy --all-targets --all-features -- -D warnings - cargo fmt --all -- --check @@ -84,7 +91,11 @@ matrix: os: windows env: TARGET=x86_64-pc-windows-msvc rust: beta + before_script: + - rustup component add rustfmt + - rustfmt --version script: + - cargo fmt --all -- --check - cargo test --verbose - cargo build --verbose @@ -95,6 +106,7 @@ matrix: before_script: - rustup component add clippy-preview - rustup component add rustfmt + - rustfmt --version script: - cargo clippy --all-targets --all-features -- -D warnings - cargo fmt --all -- --check From 2df4556f8db88f1ac8cc9afb28263ffbd11d3340 Mon Sep 17 00:00:00 2001 From: Chaya Danzinger Date: Mon, 31 Dec 2018 12:48:34 -0500 Subject: [PATCH 3/4] add files changed by local rustfmt run --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 85e94c9..8c78aa9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ extern crate clap; extern crate supernova; -use clap::{App, Arg, crate_name, crate_version}; +use clap::{crate_name, crate_version, App, Arg}; use std::process; use supernova::Config; @@ -12,13 +12,15 @@ fn main() { Arg::with_name("USERNAME") .help("The user whose stars to collect") .required(true), - ).arg( + ) + .arg( Arg::with_name("TOKEN") .short("t") .long("token") .help("Sets the authentication token for requests to GitHub") .takes_value(true), - ).get_matches() + ) + .get_matches() .into(); if let Err(e) = supernova::collect_stars(config) { From 579306acb1c52718e00de99f4c43e5a3dbd58487 Mon Sep 17 00:00:00 2001 From: Chaya Danzinger Date: Wed, 2 Jan 2019 13:43:33 -0500 Subject: [PATCH 4/4] add line to print out clippy version (issue #32) --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index a74483a..543c52a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ matrix: rust: stable before_script: - rustup component add clippy-preview + - cargo clippy --version - rustup component add rustfmt - rustfmt --version script: @@ -64,6 +65,7 @@ matrix: rust: nightly before_script: - rustup component add clippy-preview + - cargo clippy --version - rustup component add rustfmt - rustfmt --version script: @@ -78,6 +80,7 @@ matrix: rust: stable before_script: - rustup component add clippy-preview + - cargo clippy --version - rustup component add rustfmt - rustfmt --version script: @@ -105,6 +108,7 @@ matrix: rust: nightly before_script: - rustup component add clippy-preview + - cargo clippy --version - rustup component add rustfmt - rustfmt --version script: