From bf249333cdfbe026b3d0a8a9fb00e2251c7812d3 Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Mon, 18 Jun 2018 02:39:19 +0000 Subject: [PATCH] Add clippy to CI Closes: #240 Approved by: dlrobertson --- .travis.yml | 3 +++ src/lib.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index c1fb58690..2809c8edf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,8 @@ matrix: MODE='build' - rust: nightly env: MODE='fuzz run' ARGS='packet_parser -- -max_len=1536 -max_total_time=30' + - rust: nightly + env: FEATURES='default' MODE='clippy' allow_failures: # something's screwy with Travis (as usual) and cargo-fuzz dies with a LeakSanitizer error # even when it's successful. Keep this in .travis.yml in case it starts working some day. @@ -44,6 +46,7 @@ matrix: env: MODE='fuzz run' ARGS='packet_parser -- -max_len=1536 -max_total_time=30' before_script: - if [ "$MODE" == "fuzz run" ]; then cargo install cargo-fuzz; fi + - if [ "$MODE" == "clippy" ]; then cargo install clippy; fi script: - cargo $MODE --no-default-features --features "$FEATURES" $ARGS notifications: diff --git a/src/lib.rs b/src/lib.rs index 09a3fa0b9..93d90a139 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,6 +88,9 @@ feature = "socket-tcp")))] compile_error!("at least one socket needs to be enabled"); */ +// FIXME(dlrobertson): clippy fails with this lint +#![cfg_attr(feature = "cargo-clippy", allow(if_same_then_else))] + #[cfg(feature = "proto-ipv6")] #[macro_use] extern crate bitflags;