From 18624ddf1d5694d400add1c92083b46ea0a271a4 Mon Sep 17 00:00:00 2001 From: Josh Holmer Date: Wed, 11 Jan 2017 09:10:10 -0500 Subject: [PATCH] Add clippy as an optional dependency (enabled via `cargo build --features clippy`) --- codegen/Cargo.toml | 4 ++++ codegen/src/lib.rs | 3 +++ contrib/Cargo.toml | 4 ++++ contrib/src/lib.rs | 4 ++++ lib/Cargo.toml | 4 ++++ lib/src/lib.rs | 3 +++ 6 files changed, 22 insertions(+) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index be23fbb6..32ba68c7 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -18,6 +18,10 @@ plugin = true rocket = { version = "0.1.4", path = "../lib/" } log = "^0.3" +[dependencies.clippy] +version = ">=0.0.106" +optional = true + [dev-dependencies] compiletest_rs = "^0.2" diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 4bf6a52f..fc949f7e 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -95,6 +95,9 @@ #![feature(i128_type)] #![allow(unused_attributes)] #![allow(deprecated)] +#![cfg_attr(feature="clippy", feature(plugin))] +#![cfg_attr(feature="clippy", plugin(clippy))] +#![cfg_attr(feature="clippy", allow(needless_lifetimes))] #[macro_use] extern crate syntax; #[macro_use] extern crate log; diff --git a/contrib/Cargo.toml b/contrib/Cargo.toml index 18ce34f5..ee308392 100644 --- a/contrib/Cargo.toml +++ b/contrib/Cargo.toml @@ -33,3 +33,7 @@ handlebars = { version = "^0.23", optional = true, features = ["serde_type"] } glob = { version = "^0.2", optional = true } lazy_static = { version = "^0.2", optional = true } tera = { version = "^0.6", optional = true } + +[dependencies.clippy] +version = ">=0.0.106" +optional = true diff --git a/contrib/src/lib.rs b/contrib/src/lib.rs index 8d06d2d4..dc9fdc49 100644 --- a/contrib/src/lib.rs +++ b/contrib/src/lib.rs @@ -29,6 +29,10 @@ //! This crate is expected to grow with time, bringing in outside crates to be //! officially supported by Rocket. +#![cfg_attr(feature="clippy", feature(plugin))] +#![cfg_attr(feature="clippy", plugin(clippy))] +#![cfg_attr(feature="clippy", allow(needless_lifetimes))] + #[macro_use] extern crate log; #[macro_use] extern crate rocket; diff --git a/lib/Cargo.toml b/lib/Cargo.toml index af8a2883..1544da69 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -20,6 +20,10 @@ url = "^1" toml = "^0.2" # cookie = "^0.3" +[dependencies.clippy] +version = ">=0.0.106" +optional = true + [dependencies.hyper] version = "^0.9" default-features = false diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 5afc04dd..1d912220 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -4,6 +4,9 @@ #![feature(associated_consts)] #![feature(const_fn)] #![feature(type_ascription)] +#![cfg_attr(feature="clippy", feature(plugin))] +#![cfg_attr(feature="clippy", plugin(clippy))] +#![cfg_attr(feature="clippy", allow(needless_lifetimes))] //! # Rocket - Core API Documentation //!