From e00fe75d37e834c0ccb0599fbff850c57fb7bc95 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Thu, 14 Jan 2016 09:03:18 +0100 Subject: [PATCH] Add clippy --- Cargo.lock | 28 ++++++++++++++++++++++++++++ Cargo.toml | 8 +++++++- src/main.rs | 6 ++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 07ce8fb..057b75b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,6 +3,7 @@ name = "tldr" version = "0.1.0" dependencies = [ "ansi_term 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "clippy 0.0.37 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.78 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -36,6 +37,15 @@ name = "ansi_term" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "clippy" +version = "0.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "curl" version = "0.2.15" @@ -177,6 +187,11 @@ dependencies = [ "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nom" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "openssl-sys" version = "0.7.4" @@ -232,6 +247,14 @@ name = "rustc-serialize" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "semver" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "strsim" version = "0.3.0" @@ -265,6 +288,11 @@ dependencies = [ "winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-normalization" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "url" version = "0.2.38" diff --git a/Cargo.toml b/Cargo.toml index 13aa97e..7995811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,15 @@ name = "tldr" version = "0.1.0" authors = ["Danilo Bargen "] +repository = "https://github.com/dbrgn/tldr-rs/" +homepage = "https://github.com/dbrgn/tldr-rs/" license = "MIT/Apache-2.0" +readme = "README.md" +description = "Fetch and show tldr help pages for many CLI commands." [features] logging = ["env_logger"] +dev = ["clippy"] [dependencies] ansi_term = "^0.7" @@ -13,8 +18,9 @@ log = "^0.3" tar = { git = "https://github.com/dbrgn/tar-rs", branch = "pax_header" } flate2 = "^0.2" curl = "^0.2" -env_logger = { version = "^0.3", optional = true } rustc-serialize = "^0.3" docopt = "^0.6" time = "^0.1" walkdir = "^0.1" +env_logger = { version = "^0.3", optional = true } +clippy = {version = "0.0.37", optional = true} diff --git a/src/main.rs b/src/main.rs index b1995e4..3da5748 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,12 @@ missing_copy_implementations, unused_extern_crates, unused_results)] +#![cfg_attr(feature = "dev", feature(plugin))] +#![cfg_attr(feature = "dev", plugin(clippy))] +#![cfg_attr(feature = "dev", warn(cast_possible_truncation, cast_possible_wrap, cast_precision_loss, cast_sign_loss, + mut_mut, non_ascii_literal, option_unwrap_used, result_unwrap_used, + shadow_reuse, shadow_same, unicode_not_nfc, + wrong_self_convention, wrong_pub_self_convention))] #[macro_use] extern crate log; #[cfg(feature = "logging")]extern crate env_logger;