Skip to content

Commit

Permalink
add clippy::
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed Nov 26, 2018
1 parent 7cd4a94 commit dad9fe6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/bin/cargo/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(redundant_closure))] // there's a false positive
#![cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_arguments))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(clippy::redundant_closure))] // there's a false positive

extern crate cargo;
extern crate clap;
Expand All @@ -13,10 +13,10 @@ extern crate serde_derive;
extern crate serde_json;
extern crate toml;

use std::collections::BTreeSet;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::collections::BTreeSet;

use cargo::core::shell::Shell;
use cargo::util::{self, command_prelude, lev_distance, CargoResult, CliResult, Config};
Expand Down
37 changes: 19 additions & 18 deletions src/cargo/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#![cfg_attr(test, deny(warnings))]

// Clippy isn't enforced by CI, and know that @alexcrichton isn't a fan :)
#![cfg_attr(feature = "cargo-clippy", allow(boxed_local))] // bug rust-lang-nursery/rust-clippy#1123
#![cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(derive_hash_xor_eq))] // there's an intentional incoherence
#![cfg_attr(feature = "cargo-clippy", allow(explicit_into_iter_loop))] // explicit loops are clearer
#![cfg_attr(feature = "cargo-clippy", allow(explicit_iter_loop))] // explicit loops are clearer
#![cfg_attr(feature = "cargo-clippy", allow(identity_op))] // used for vertical alignment
#![cfg_attr(feature = "cargo-clippy", allow(implicit_hasher))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(redundant_closure_call))] // closures over try catch blocks
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))] // there's an exceptionally complex type
#![cfg_attr(feature = "cargo-clippy", allow(wrong_self_convention))] // perhaps Rc should be special cased in Clippy?
#![cfg_attr(feature = "cargo-clippy", allow(clippy::boxed_local))] // bug rust-lang-nursery/rust-clippy#1123
#![cfg_attr(feature = "cargo-clippy", allow(clippy::cyclomatic_complexity))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(clippy::derive_hash_xor_eq))] // there's an intentional incoherence
#![cfg_attr(feature = "cargo-clippy", allow(clippy::explicit_into_iter_loop))] // explicit loops are clearer
#![cfg_attr(feature = "cargo-clippy", allow(clippy::explicit_iter_loop))] // explicit loops are clearer
#![cfg_attr(feature = "cargo-clippy", allow(clippy::identity_op))] // used for vertical alignment
#![cfg_attr(feature = "cargo-clippy", allow(clippy::implicit_hasher))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(clippy::large_enum_variant))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(clippy::redundant_closure_call))] // closures over try catch blocks
#![cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_arguments))] // large project
#![cfg_attr(feature = "cargo-clippy", allow(clippy::type_complexity))] // there's an exceptionally complex type
#![cfg_attr(feature = "cargo-clippy", allow(clippy::wrong_self_convention))] // perhaps Rc should be special cased in Clippy?

extern crate atty;
extern crate bytesize;
Expand Down Expand Up @@ -55,25 +54,25 @@ extern crate serde_derive;
extern crate serde_ignored;
#[macro_use]
extern crate serde_json;
extern crate im_rc;
extern crate shell_escape;
extern crate tar;
extern crate tempfile;
extern crate termcolor;
extern crate toml;
extern crate unicode_width;
extern crate url;
extern crate im_rc;

use std::fmt;

use serde::ser;
use failure::Error;
use serde::ser;

use core::Shell;
use core::shell::Verbosity::Verbose;
use core::Shell;

pub use util::{CargoError, CargoResult, CliError, CliResult, Config};
pub use util::errors::Internal;
pub use util::{CargoError, CargoResult, CliError, CliResult, Config};

pub const CARGO_ENV: &str = "CARGO";

Expand Down Expand Up @@ -210,7 +209,9 @@ fn handle_cause(cargo_err: &Error, shell: &mut Shell) -> bool {

pub fn version() -> VersionInfo {
macro_rules! option_env_str {
($name:expr) => { option_env!($name).map(|s| s.to_string()) }
($name:expr) => {
option_env!($name).map(|s| s.to_string())
};
}

// So this is pretty horrible...
Expand Down

0 comments on commit dad9fe6

Please sign in to comment.