Enable Clippy in travis

This will run clippy on all builds, and as long as clippy successfully compiles
it will deny builds that fail clippy lints.
This commit is contained in:
Brandon W Maister 2017-06-24 12:27:37 -05:00
parent 5643b845a5
commit 1f625fe69d
2 changed files with 21 additions and 1 deletions

View File

@ -46,11 +46,25 @@ build_only() {
channel build -v --features 'serde bincode' channel build -v --features 'serde bincode'
} }
run_clippy() {
# cached installation will not work on a later nightly
if [ -n "${TRAVIS}" ] && ! cargo install clippy --debug --force; then
echo "COULD NOT COMPILE CLIPPY, IGNORING CLIPPY TESTS"
exit
fi
cargo clippy --features 'serde bincode rustc-serialize' -- -Dclippy
}
rustc --version rustc --version
cargo --version cargo --version
CHANNEL=nightly CHANNEL=nightly
if [ "x${CLIPPY}" = xy ] ; then
run_clippy
else
build_and_test build_and_test
fi
CHANNEL=beta CHANNEL=beta
build_and_test build_and_test

View File

@ -12,9 +12,15 @@ os:
matrix: matrix:
allow_failures: allow_failures:
- rust: nightly - rust: nightly
env: CLIPPY=n
include:
- rust: nightly
env: CLIPPY=y
env: env:
global: global:
- LD_LIBRARY_PATH: /usr/local/lib - LD_LIBRARY_PATH: /usr/local/lib
- CLIPPY: n
script: ./.travis.sh script: ./.travis.sh
notifications: notifications:
email: false email: false