diff --git a/crates/bevy_sprite/src/lib.rs b/crates/bevy_sprite/src/lib.rs index 543ca5c3dbc3a..173ef17f7deec 100644 --- a/crates/bevy_sprite/src/lib.rs +++ b/crates/bevy_sprite/src/lib.rs @@ -1,6 +1,11 @@ #![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")] #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![forbid(unsafe_code)] +#![deny( + clippy::allow_attributes, + clippy::allow_attributes_without_reason, + reason = "See #17111; To be removed once all crates are in-line with these attributes" +)] #![doc( html_logo_url = "https://bevyengine.org/assets/icon.png", html_favicon_url = "https://bevyengine.org/assets/icon.png" @@ -64,6 +69,14 @@ pub struct SpritePlugin { pub add_picking: bool, } +#[expect( + clippy::allow_attributes, + reason = "clippy::derivable_impls is not always linted" +)] +#[allow( + clippy::derivable_impls, + reason = "Known false positive with clippy: " +)] impl Default for SpritePlugin { fn default() -> Self { Self { diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index 977e4a81bf129..b350136ef080f 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -135,7 +135,10 @@ pub trait Material2d: AsBindGroup + Asset + Clone + Sized { } /// Customizes the default [`RenderPipelineDescriptor`]. - #[allow(unused_variables)] + #[expect( + unused_variables, + reason = "The parameters here are intentionally unused by the default implementation; however, putting underscores here will result in the underscores being copied by rust-analyzer's tab completion." + )] #[inline] fn specialize( descriptor: &mut RenderPipelineDescriptor, @@ -464,7 +467,10 @@ pub const fn tonemapping_pipeline_key(tonemapping: Tonemapping) -> Mesh2dPipelin } } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] pub fn queue_material2d_meshes( opaque_draw_functions: Res>, alpha_mask_draw_functions: Res>, diff --git a/crates/bevy_sprite/src/mesh2d/mesh.rs b/crates/bevy_sprite/src/mesh2d/mesh.rs index 92abdeb68a557..bd12a0412f711 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh.rs +++ b/crates/bevy_sprite/src/mesh2d/mesh.rs @@ -717,7 +717,10 @@ pub struct Mesh2dViewBindGroup { pub value: BindGroup, } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] pub fn prepare_mesh2d_view_bind_groups( mut commands: Commands, render_device: Res, diff --git a/crates/bevy_sprite/src/mesh2d/wireframe2d.rs b/crates/bevy_sprite/src/mesh2d/wireframe2d.rs index 6f2659fbaaf91..c36e945ec5a0b 100644 --- a/crates/bevy_sprite/src/mesh2d/wireframe2d.rs +++ b/crates/bevy_sprite/src/mesh2d/wireframe2d.rs @@ -124,7 +124,10 @@ fn global_color_changed( } /// Updates the wireframe material when the color in [`Wireframe2dColor`] changes -#[allow(clippy::type_complexity)] +#[expect( + clippy::type_complexity, + reason = "Can't be rewritten with less complex arguments." +)] fn wireframe_color_changed( mut materials: ResMut>, mut colors_changed: Query< diff --git a/crates/bevy_sprite/src/picking_backend.rs b/crates/bevy_sprite/src/picking_backend.rs index 5d1e652db3a7d..aef7bc5c2403c 100644 --- a/crates/bevy_sprite/src/picking_backend.rs +++ b/crates/bevy_sprite/src/picking_backend.rs @@ -54,7 +54,10 @@ impl Plugin for SpritePickingPlugin { } } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] fn sprite_picking( pointers: Query<(&PointerId, &PointerLocation)>, cameras: Query<(Entity, &Camera, &GlobalTransform, &Projection)>, diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index 1c91bdd603062..014fd779eed5d 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -494,7 +494,10 @@ pub struct ImageBindGroups { values: HashMap, BindGroup>, } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] pub fn queue_sprites( mut view_entities: Local, draw_functions: Res>, @@ -582,7 +585,10 @@ pub fn queue_sprites( } } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] pub fn prepare_sprite_view_bind_groups( mut commands: Commands, render_device: Res, @@ -616,7 +622,10 @@ pub fn prepare_sprite_view_bind_groups( } } -#[allow(clippy::too_many_arguments)] +#[expect( + clippy::too_many_arguments, + reason = "Could be rewritten with less arguments using a QueryData-implementing struct, but doesn't need to be." +)] pub fn prepare_sprite_image_bind_groups( mut commands: Commands, mut previous_len: Local,