From f3f08936d87c00c469a897bcc6fd216fdfa6e06c Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Tue, 7 Dec 2021 18:33:46 -0500 Subject: [PATCH] Decrease too-many-arguments-threshold and type-complexity-threshold. --- clippy.toml | 4 ++-- common/systems/src/phys.rs | 1 + server/src/sys/entity_sync.rs | 1 + server/src/sys/msg/in_game.rs | 2 ++ server/src/sys/terrain.rs | 1 + voxygen/src/hud/bag.rs | 2 ++ voxygen/src/hud/skillbar.rs | 1 + voxygen/src/mesh/terrain.rs | 1 + voxygen/src/render/pipelines/mod.rs | 1 + world/src/sim/erosion.rs | 2 ++ 10 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clippy.toml b/clippy.toml index cb4a22ef8c..b7748bf6bd 100644 --- a/clippy.toml +++ b/clippy.toml @@ -10,7 +10,7 @@ # `too_many_arguments` often flags `new` methods on structs that legitimately # ought to have many parameters -too-many-arguments-threshold = 4294967295 +too-many-arguments-threshold = 15 # `many_single_char_names` often triggers for geometry or physics code with an # associated diagram, where the short names are points in the diagram. @@ -19,4 +19,4 @@ single-char-binding-names-threshold = 4294967295 # `type_complexity` often triggers for the RHS of an associated type: it's # telling you that a type is complicated enough to need a name, at the point # where you're giving it a name. -type-complexity-threshold = 4294967295 +type-complexity-threshold = 750 diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index 32dd82bf89..985005aa00 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -1764,6 +1764,7 @@ fn voxel_collider_bounding_sphere( } /// Returns whether interesction between entities occured +#[allow(clippy::too_many_arguments)] fn resolve_e2e_collision( // utility variables for our entity collision_registered: &mut bool, diff --git a/server/src/sys/entity_sync.rs b/server/src/sys/entity_sync.rs index 3c21536600..59046f83d2 100644 --- a/server/src/sys/entity_sync.rs +++ b/server/src/sys/entity_sync.rs @@ -25,6 +25,7 @@ use vek::*; pub struct Sys; impl<'a> System<'a> for Sys { + #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, Tick>, diff --git a/server/src/sys/msg/in_game.rs b/server/src/sys/msg/in_game.rs index 142e2f3652..1cfde3744c 100644 --- a/server/src/sys/msg/in_game.rs +++ b/server/src/sys/msg/in_game.rs @@ -26,6 +26,7 @@ pub type TerrainPersistenceData<'a> = Option>; pub type TerrainPersistenceData<'a> = (); impl Sys { + #[allow(clippy::too_many_arguments)] fn handle_client_in_game_msg( server_emitter: &mut common::event::Emitter<'_, ServerEvent>, entity: specs::Entity, @@ -303,6 +304,7 @@ impl Sys { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { + #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, EventBus>, diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index de787e40ce..da82953974 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -106,6 +106,7 @@ impl LazyTerrainMessage { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { + #[allow(clippy::type_complexity)] type SystemData = ( Read<'a, EventBus>, Read<'a, Tick>, diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 6a9d6a1bba..cdb925406a 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -91,6 +91,7 @@ pub struct InventoryScroller<'a> { } impl<'a> InventoryScroller<'a> { + #[allow(clippy::too_many_arguments)] pub fn new( client: &'a Client, imgs: &'a Imgs, @@ -582,6 +583,7 @@ pub struct Bag<'a> { } impl<'a> Bag<'a> { + #[allow(clippy::too_many_arguments)] pub fn new( client: &'a Client, global_state: &'a GlobalState, diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 7fcac7045e..411e4ae5b3 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -267,6 +267,7 @@ pub struct Skillbar<'a> { } impl<'a> Skillbar<'a> { + #[allow(clippy::too_many_arguments)] pub fn new( client: &'a Client, global_state: &'a GlobalState, diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 3e2164a1e8..8e13ee8cce 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -224,6 +224,7 @@ fn calc_light + ReadVol + Debug>( } } +#[allow(clippy::type_complexity)] pub fn generate_mesh<'a, V: RectRasterableVol + ReadVol + Debug + 'static>( vol: &'a VolGrid2d, (range, max_texture_size, _boi): (Aabb, Vec2, &'a BlocksOfInterest), diff --git a/voxygen/src/render/pipelines/mod.rs b/voxygen/src/render/pipelines/mod.rs index 6a0318875f..fac31813dc 100644 --- a/voxygen/src/render/pipelines/mod.rs +++ b/voxygen/src/render/pipelines/mod.rs @@ -81,6 +81,7 @@ pub struct Shadow { impl Globals { /// Create global consts from the provided parameters. + #[allow(clippy::too_many_arguments)] pub fn new( view_mat: Mat4, proj_mat: Mat4, diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index 81403c7826..6b533f5e9d 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -697,6 +697,7 @@ impl m32 { /// Prediction in Geomorphology, Geophysical Monograph 135. /// Copyright 2003 by the American Geophysical Union /// 10.1029/135GM09 +#[allow(clippy::too_many_arguments)] fn erode( // Underlying map dimensions. map_size_lg: MapSizeLg, @@ -2530,6 +2531,7 @@ pub fn get_multi_rec>( } /// Perform erosion n times. +#[allow(clippy::too_many_arguments)] pub fn do_erosion( map_size_lg: MapSizeLg, _max_uplift: f32,