Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run clippy with nightly rust on CI #6347

Merged
merged 22 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/rust/engine/async_semaphore/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate futures;

use std::collections::VecDeque;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/boxfuture/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
// https://github.com/alexcrichton/futures-rs/issues/228 has background for its removal.
// This avoids needing to call Box::new() around every future that we produce.

// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate futures;

use futures::future::Future;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/build_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a bug filed about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rust-lang/rfcs#752 - will link

#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

use std::env;
use std::io;
use std::ops::Deref;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/fs/brfs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate bazel_protos;
extern crate clap;
extern crate dirs;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/fs/fs_util/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

#[macro_use]
extern crate boxfuture;
extern crate bytes;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/fs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

mod glob_matching;
pub use glob_matching::GlobMatching;
mod snapshot;
Expand Down
1 change: 1 addition & 0 deletions src/rust/engine/graph/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl Generation {
}
}

#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
pub(crate) enum EntryState<N: Node> {
// A node that has either been explicitly cleared, or has not yet started Running. In this state
// there is no need for a dirty bit because the RunToken is either in its initial state, or has
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/graph/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate boxfuture;
extern crate fnv;
extern crate futures;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/hashing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate digest;
extern crate hex;
extern crate sha2;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/process_execution/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate async_semaphore;
extern crate bazel_protos;
#[macro_use]
Expand Down
15 changes: 15 additions & 0 deletions src/rust/engine/process_executor/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

#[macro_use]
extern crate clap;
extern crate env_logger;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/resettable/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

use std::sync::{Arc, RwLock};

///
Expand Down
1 change: 1 addition & 0 deletions src/rust/engine/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct Core {
}

impl Core {
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
pub fn new(
root_subject_types: Vec<TypeId>,
tasks: Tasks,
Expand Down
21 changes: 21 additions & 0 deletions src/rust/engine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]
// We only use unsafe pointer derefrences in our no_mangle exposed API, but it is nicer to list
// just the one minor call as unsafe, than to mark the whole function as unsafe which may hide
// other unsafeness.
#![cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))]

pub mod cffi_externs;
mod context;
mod core;
Expand Down
19 changes: 19 additions & 0 deletions src/rust/engine/testutil/mock/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]
// We use a bunch of complex compound tuples for storing call arguments.
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))]

extern crate bazel_protos;
extern crate bytes;
extern crate futures;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/testutil/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate bazel_protos;
extern crate bytes;
extern crate digest;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/ui/src/display.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate rand;
extern crate termion;
extern crate unicode_segmentation;
Expand Down
17 changes: 17 additions & 0 deletions src/rust/engine/ui/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source.
#![cfg_attr(
feature = "cargo-clippy",
deny(
clippy, default_trait_access, expl_impl_clone_on_copy, if_not_else, needless_continue,
single_match_else, unseparated_literal_suffix, used_underscore_binding
)
)]
// It is often more clear to show that nothing is being moved.
#![cfg_attr(feature = "cargo-clippy", allow(match_ref_pats))]
// Subjective style.
#![cfg_attr(feature = "cargo-clippy", allow(len_without_is_empty, redundant_field_names))]
// Default isn't as big a deal as people seem to think it is.
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, new_without_default_derive))]
// Arc<Mutex> can be more clear than needing to grok Orderings:
#![cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]

extern crate engine_display;
extern crate rand;

Expand Down