Skip to content

Commit

Permalink
Lints from latest nightly
Browse files Browse the repository at this point in the history
We can't adopt it due to some issue with building the runtime, but these are
good to have.
  • Loading branch information
kayabaNerve committed Sep 1, 2024
1 parent a506d74 commit 4e83487
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 7 deletions.
1 change: 1 addition & 0 deletions crypto/ff-group-tests/src/prime_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub fn test_from_u128<F: PrimeField>() {
}

/// Test is_odd/is_even works.
///
/// This test assumes an odd modulus with oddness being determined by the least-significant bit.
/// Accordingly, this test doesn't support fields alternatively defined.
/// TODO: Improve in the future.
Expand Down
2 changes: 1 addition & 1 deletion substrate/coins/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl AllowMint for () {
}

// TODO: Investigate why Substrate generates this
#[allow(clippy::cast_possible_truncation)]
#[allow(unreachable_patterns, clippy::cast_possible_truncation)]
#[frame_support::pallet]
pub mod pallet {
use super::*;
Expand Down
6 changes: 5 additions & 1 deletion substrate/dex/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ pub use types::*;
pub use weights::WeightInfo;

// TODO: Investigate why Substrate generates these
#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding)]
#[allow(
unreachable_patterns,
clippy::cast_possible_truncation,
clippy::no_effect_underscore_binding
)]
#[frame_support::pallet]
pub mod pallet {
use super::*;
Expand Down
7 changes: 6 additions & 1 deletion substrate/economic-security/pallet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#![cfg_attr(not(feature = "std"), no_std)]

#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)]
#[allow(
unreachable_patterns,
clippy::cast_possible_truncation,
clippy::no_effect_underscore_binding,
clippy::empty_docs
)]
#[frame_support::pallet]
pub mod pallet {
use frame_system::pallet_prelude::*;
Expand Down
8 changes: 6 additions & 2 deletions substrate/emissions/pallet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#![cfg_attr(not(feature = "std"), no_std)]

#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)]
#[allow(
unreachable_patterns,
clippy::cast_possible_truncation,
clippy::no_effect_underscore_binding,
clippy::empty_docs
)]
#[frame_support::pallet]
pub mod pallet {
use super::*;
use frame_system::{pallet_prelude::*, RawOrigin};
use frame_support::{pallet_prelude::*, sp_runtime::SaturatedConversion};

use sp_std::{vec, vec::Vec, ops::Mul, collections::btree_map::BTreeMap};
use sp_runtime;

use coins_pallet::{Config as CoinsConfig, Pallet as Coins};
use dex_pallet::{Config as DexConfig, Pallet as Dex};
Expand Down
7 changes: 6 additions & 1 deletion substrate/genesis-liquidity/pallet/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#![cfg_attr(not(feature = "std"), no_std)]

#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)]
#[allow(
unreachable_patterns,
clippy::cast_possible_truncation,
clippy::no_effect_underscore_binding,
clippy::empty_docs
)]
#[frame_support::pallet]
pub mod pallet {
use super::*;
Expand Down
7 changes: 6 additions & 1 deletion substrate/in-instructions/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ pub use in_instructions_primitives as primitives;
use primitives::*;

// TODO: Investigate why Substrate generates these
#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)]
#[allow(
unreachable_patterns,
clippy::cast_possible_truncation,
clippy::no_effect_underscore_binding,
clippy::empty_docs
)]
#[frame_support::pallet]
pub mod pallet {
use sp_std::vec;
Expand Down
1 change: 1 addition & 0 deletions substrate/signals/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#[allow(
deprecated,
unreachable_patterns,
clippy::let_unit_value,
clippy::cast_possible_truncation,
clippy::ignored_unit_patterns
Expand Down
1 change: 1 addition & 0 deletions substrate/validator-sets/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl<T: pallet::Config> GetValidatorCount for MembershipProof<T> {

#[allow(
deprecated,
unreachable_patterns,
clippy::let_unit_value,
clippy::cast_possible_truncation,
clippy::ignored_unit_patterns
Expand Down

0 comments on commit 4e83487

Please sign in to comment.