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

[Merged by Bors] - Lint for sum and product in consensus code #2226

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions consensus/state_processing/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Disallow sum and product methods which are prone to overflow.
disallowed-methods = [
"core::iter::traits::iterator::Iterator::sum",
"core::iter::traits::iterator::Iterator::product",
]
1 change: 1 addition & 0 deletions consensus/state_processing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::disallowed_method)]

#[macro_use]
mod macros;
Expand Down
5 changes: 5 additions & 0 deletions consensus/types/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Disallow sum and product methods which are prone to overflow.
disallowed-methods = [
"core::iter::traits::iterator::Iterator::sum",
"core::iter::traits::iterator::Iterator::product",
]
1 change: 1 addition & 0 deletions consensus/types/src/beacon_state/tree_hash_cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(clippy::integer_arithmetic)]
#![allow(clippy::disallowed_method)]

use super::Error;
use crate::{BeaconState, EthSpec, Hash256, Slot, Unsigned, Validator};
Expand Down
1 change: 1 addition & 0 deletions consensus/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#![recursion_limit = "128"]
// Clippy lint set up
#![deny(clippy::integer_arithmetic)]
#![deny(clippy::disallowed_method)]

#[macro_use]
extern crate lazy_static;
Expand Down