Skip to content

Commit 5720602

Browse files
authored
Merge pull request #207 from mozilla/fix-rustfmt-check
Don't run rustfmt check in nightly; fix bug
2 parents dfb615f + 498eddf commit 5720602

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ env:
1414
- RELEASE=--release
1515

1616
before_script:
17-
- rustup component add rustfmt
17+
# rustfmt may not always be available in nightly
18+
- if [[ "$TRAVIS_RUST_VERSION" != *nightly* ]]; then rustup component add rustfmt; fi
1819

1920
script:
2021
- cargo test --all --verbose $RELEASE
@@ -26,4 +27,5 @@ script:
2627
# See https://github.com/mozilla/mp4parse-rust/issues/197
2728
- cargo check --all --verbose $RELEASE --tests --all-features
2829
- cargo doc --package mp4parse_capi
29-
- cargo fmt -- --check || echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt -- --version))"
30+
# The `false` after `echo` is necessary to avoid false negatives due to `echo` returning success
31+
- if [[ "$TRAVIS_RUST_VERSION" != *nightly* ]]; then cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt -- --version))"; false); fi

0 commit comments

Comments
 (0)