From 8802fb2fd83500c6cc373e9b23ebc5ab93772e63 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sat, 13 Feb 2016 02:31:23 +0530 Subject: [PATCH] Make clippy an optional dependency --- .travis.yml | 2 +- Cargo.lock | 4 ---- Cargo.toml | 3 ++- ethcore/Cargo.toml | 3 ++- ethcore/src/lib.rs | 5 ++--- parity/main.rs | 2 +- rpc/Cargo.toml | 6 +++++- rpc/src/lib.rs | 2 +- sync/Cargo.toml | 6 +++++- sync/src/lib.rs | 4 ++-- util/Cargo.toml | 6 +++++- util/src/lib.rs | 4 ++-- 12 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2859589b..0abda2c30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: fast_finish: true include: - rust: nightly - env: FEATURES="--features ethcore/json-tests" KCOV_FEATURES="" TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity" ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}" + env: FEATURES='--features "ethcore/json-tests dev"' KCOV_FEATURES="" TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity" ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}" cache: apt: true directories: diff --git a/Cargo.lock b/Cargo.lock index 1e9f57900..94b9a3b91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -167,7 +167,6 @@ dependencies = [ name = "ethcore" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethash 0.9.99", @@ -186,7 +185,6 @@ dependencies = [ name = "ethcore-rpc" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 0.9.99", "ethcore-util 0.9.99", "ethsync 0.9.99", @@ -204,7 +202,6 @@ name = "ethcore-util" version = "0.9.99" dependencies = [ "arrayvec 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -232,7 +229,6 @@ dependencies = [ name = "ethsync" version = "0.9.99" dependencies = [ - "clippy 0.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 0.9.99", "ethcore-util 0.9.99", diff --git a/Cargo.toml b/Cargo.toml index c58cacf0d..a3fd40e34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ rustc-serialize = "0.3" docopt = "0.6" docopt_macros = "0.6" ctrlc = { git = "https://github.com/tomusdrw/rust-ctrlc.git" } -clippy = "0.0.41" +clippy = { version = "0.0.41", optional = true } ethcore-util = { path = "util" } ethcore = { path = "ethcore" } ethsync = { path = "sync" } @@ -23,6 +23,7 @@ target_info = "0.1" [features] default = ["rpc"] rpc = ["ethcore-rpc"] +dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev"] [[bin]] path = "parity/main.rs" diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 3d4d27520..4aafebba1 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -18,7 +18,7 @@ ethcore-util = { path = "../util" } evmjit = { path = "../evmjit", optional = true } ethash = { path = "../ethash" } num_cpus = "0.2" -clippy = "0.0.41" +clippy = { version = "0.0.41", optional = true } crossbeam = "0.1.5" lazy_static = "0.1" @@ -27,3 +27,4 @@ jit = ["evmjit"] evm-debug = [] json-tests = [] test-heavy = [] +dev = ["clippy"] diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 4cca74319..093906bd0 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -17,9 +17,8 @@ #![warn(missing_docs)] #![feature(cell_extras)] #![feature(augmented_assignments)] -#![feature(plugin)] -// Clippy -#![plugin(clippy)] +#![cfg_attr(feature="dev", feature(plugin))] +#![cfg_attr(feature="dev", plugin(clippy))] // TODO [todr] not really sure #![allow(needless_range_loop)] // Shorter than if-else diff --git a/parity/main.rs b/parity/main.rs index 460922b64..eadaa4968 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -19,7 +19,7 @@ #![warn(missing_docs)] #![feature(plugin)] #![plugin(docopt_macros)] -#![plugin(clippy)] +#![cfg_attr(feature="dev", plugin(clippy))] extern crate docopt; extern crate rustc_serialize; extern crate ethcore_util as util; diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index b1af0a2fa..107e22c07 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -16,6 +16,10 @@ jsonrpc-http-server = "1.1.2" ethcore-util = { path = "../util" } ethcore = { path = "../ethcore" } ethsync = { path = "../sync" } -clippy = "0.0.41" +clippy = { version = "0.0.41", optional = true } target_info = "0.1.0" rustc-serialize = "0.3" + +[features] +default = [] +dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev"] diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 0b148c983..cd059e6b1 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -18,7 +18,7 @@ #![warn(missing_docs)] #![feature(custom_derive, custom_attribute, plugin)] #![plugin(serde_macros)] -#![plugin(clippy)] +#![cfg_attr(feature="dev", plugin(clippy))] extern crate rustc_serialize; extern crate target_info; diff --git a/sync/Cargo.toml b/sync/Cargo.toml index 92b46fc57..fc56ba2b9 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -10,8 +10,12 @@ authors = ["Ethcore . #![warn(missing_docs)] -#![feature(plugin)] +#![cfg_attr(feature="dev", feature(plugin))] +#![cfg_attr(feature="dev", plugin(clippy))] #![feature(augmented_assignments)] -#![plugin(clippy)] // Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref. #![allow(clone_on_copy)] diff --git a/util/Cargo.toml b/util/Cargo.toml index 9ead8ccf6..773e58de3 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -26,7 +26,11 @@ crossbeam = "0.2" slab = { git = "https://github.com/arkpar/slab.git" } sha3 = { path = "sha3" } serde = "0.6.7" -clippy = "0.0.41" +clippy = { version = "0.0.41", optional = true } json-tests = { path = "json-tests" } target_info = "0.1.0" igd = "0.4.2" + +[features] +default = [] +dev = ["clippy"] \ No newline at end of file diff --git a/util/src/lib.rs b/util/src/lib.rs index d4f972800..0a2b0f4b4 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -18,10 +18,10 @@ #![feature(op_assign_traits)] #![feature(augmented_assignments)] #![feature(associated_consts)] -#![feature(plugin)] +#![cfg_attr(feature="dev", feature(plugin))] +#![cfg_attr(feature="dev", plugin(clippy))] #![feature(catch_panic)] // Clippy settings -#![plugin(clippy)] // TODO [todr] not really sure #![allow(needless_range_loop)] // Shorter than if-else