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:
parent
5643b845a5
commit
1f625fe69d
14
.travis.sh
14
.travis.sh
|
@ -46,11 +46,25 @@ build_only() {
|
|||
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
|
||||
cargo --version
|
||||
|
||||
CHANNEL=nightly
|
||||
if [ "x${CLIPPY}" = xy ] ; then
|
||||
run_clippy
|
||||
else
|
||||
build_and_test
|
||||
fi
|
||||
|
||||
CHANNEL=beta
|
||||
build_and_test
|
||||
|
|
|
@ -12,9 +12,15 @@ os:
|
|||
matrix:
|
||||
allow_failures:
|
||||
- rust: nightly
|
||||
env: CLIPPY=n
|
||||
include:
|
||||
- rust: nightly
|
||||
env: CLIPPY=y
|
||||
|
||||
env:
|
||||
global:
|
||||
- LD_LIBRARY_PATH: /usr/local/lib
|
||||
- CLIPPY: n
|
||||
script: ./.travis.sh
|
||||
notifications:
|
||||
email: false
|
||||
|
|
Loading…
Reference in New Issue