Skip to content

Commit

Permalink
Merge branch 'rumenov/morclcd' into 'master'
Browse files Browse the repository at this point in the history
refactor: remove the clippy::too_many_arguments override when running clippy

 

See merge request dfinity-lab/public/ic!17151
  • Loading branch information
rumenov committed Jan 16, 2024
2 parents 6e09828 + 9cdd138 commit bdc3d5e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build:lint --config=clippy
# rust-clippy
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks
build --@rules_rust//:clippy.toml=//:clippy.toml --@rules_rust//:clippy_flags=-D,warnings,-D,clippy::all,-D,clippy::mem_forget,-A,clippy::too_many_arguments,-C,debug-assertions=off
build --@rules_rust//:clippy.toml=//:clippy.toml --@rules_rust//:clippy_flags=-D,warnings,-D,clippy::all,-D,clippy::mem_forget,-C,debug-assertions=off
# rustfmt
build:fmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build:fmt --output_groups=+rustfmt_checks
Expand Down
1 change: 0 additions & 1 deletion gitlab-ci/src/rust_lint/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cargo clippy --locked --all-features --workspace --all-targets -- \
-D warnings \
-D clippy::all \
-D clippy::mem_forget \
-A clippy::too_many_arguments \
-C debug-assertions=off

if cargo tree -e features | grep -q 'serde feature "rc"'; then
Expand Down
8 changes: 2 additions & 6 deletions rs/config/src/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// We disable clippy warnings for the whole module because they apply to
// generated code, meaning we can't locally disable the warnings (the code is
// defined in another module).
#![allow(clippy::redundant_closure)]
#![allow(clippy::unit_arg)]

use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -54,10 +53,7 @@ pub struct CryptoConfig {
/// Path to use for storing state on the file system.
/// It is needed for either value of `csp_vault_type`, as the config
/// is used both for starting a replica, and for starting the `CspVault`-server.
#[cfg_attr(
test,
proptest(strategy = "any::<String>().prop_map(|x| PathBuf::from(x))")
)]
#[cfg_attr(test, proptest(strategy = "any::<String>().prop_map(PathBuf::from)"))]
pub crypto_root: PathBuf,
pub csp_vault_type: CspVaultType,
}
Expand Down Expand Up @@ -198,7 +194,7 @@ mod tests {

#[test]
fn default_config_serializes_and_deserializes() {
CryptoConfig::run_with_temp_config(|config| serde_test(config));
CryptoConfig::run_with_temp_config(serde_test);
}

proptest! {
Expand Down
7 changes: 1 addition & 6 deletions rs/config/src/firewall.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::redundant_closure)]

use ic_protobuf::registry::firewall::v1::FirewallRule;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
Expand All @@ -17,10 +15,7 @@ pub const FIREWALL_FILE_DEFAULT_PATH: &str = "/This/must/not/be/a/real/path";
#[cfg_attr(test, derive(Arbitrary))]
pub struct Config {
/// Path to use for storing state on the file system
#[cfg_attr(
test,
proptest(strategy = "any::<String>().prop_map(|x| PathBuf::from(x))")
)]
#[cfg_attr(test, proptest(strategy = "any::<String>().prop_map(PathBuf::from)"))]
pub config_file: PathBuf,
pub file_template: String,
pub ipv4_tcp_rule_template: String,
Expand Down
2 changes: 2 additions & 0 deletions rs/nns/sns-wasm/src/sns_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4149,6 +4149,7 @@ mod test {
.await;
}

#[allow(clippy::too_many_arguments)]
async fn test_deploy_new_sns_request_legacy(
sns_init_payload: Option<SnsInitPayload>,
canister_api: TestCanisterApi,
Expand Down Expand Up @@ -4218,6 +4219,7 @@ mod test {
}
}

#[allow(clippy::too_many_arguments)]
async fn test_deploy_new_sns_request(
canister_wrapper: &'static LocalKey<RefCell<SnsWasmCanister<TestCanisterStableMemory>>>,
sns_init_payload: Option<SnsInitPayload>,
Expand Down
1 change: 1 addition & 0 deletions rs/p2p/quic_transport/src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl std::fmt::Display for ConnectionEstablishError {
}
}

#[allow(clippy::too_many_arguments)]
pub(crate) fn start_connection_manager(
log: &ReplicaLogger,
metrics_registry: &MetricsRegistry,
Expand Down
2 changes: 1 addition & 1 deletion rs/types/types/src/registry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// (DFN-467): We disable the clippy warning for the whole module because they
// apply to generated code, meaning we can't locally disable the warnings (the
// code is defined in another module).
#![allow(clippy::redundant_closure)]

//! Types for working with the registry.

use crate::RegistryVersion;
Expand Down

0 comments on commit bdc3d5e

Please sign in to comment.