diff --git a/.travis.yml b/.travis.yml index e268d62b..1412ca4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,23 @@ cache: # But don't cache the cargo registry before_cache: - rm -rf /home/travis/.cargo/registry - + +matrix: + # Performance tweak + fast_finish: true + # Ignore failures in nightly, not ideal, but necessary + allow_failures: + - rust: nightly + + # Only run the formatting check for stable + include: + - name: 'Rust: format check' + rust: stable + install: + - rustup component add rustfmt + script: + - cargo fmt --verbose --all -- --check + addons: apt: packages: @@ -26,14 +42,12 @@ addons: - libsdl2-dev before_script: - - rustup component add rustfmt - mkdir -p ~/.cargo - echo '[target.armv7-unknown-linux-gnueabihf]' > ~/.cargo/config - echo 'linker = "arm-linux-gnueabihf-gcc"' >> ~/.cargo/config - rustup target add armv7-unknown-linux-gnueabihf script: - - cargo fmt --all -- --check - cargo build --locked --no-default-features - cargo build --locked --examples - cargo build --locked --no-default-features --features "with-tremor" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12a14b18..2d58b9f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,10 +31,10 @@ Make any changes that you are going to make to the code, but do not commit yet. Make sure that the code is correctly formatted by running: ```bash -cargo fmt --all +cargo +stable fmt --all ``` -This command runs the previously installed ```rustfmt```, a code formatting tool that will automatically correct any formatting that you have used that does not conform with the librespot code style. Once that command has run, you will need to rebuild the project: +This command runs the previously installed stable version of ```rustfmt```, a code formatting tool that will automatically correct any formatting that you have used that does not conform with the librespot code style. Once that command has run, you will need to rebuild the project: ```bash cargo build