bevy_sprite: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (Attempt 2) (#17184)
				
					
				
			I broke the commit history on the other one, https://github.com/bevyengine/bevy/pull/17160. Woops. # Objective - https://github.com/bevyengine/bevy/issues/17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_sprite` in line with the new restrictions. ## Testing `cargo clippy` and `cargo test --package bevy_sprite` were run, and no errors were encountered.
This commit is contained in:
		
							parent
							
								
									b386d08d0f
								
							
						
					
					
						commit
						3d797d7513
					
				| @ -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: <https://github.com/rust-lang/rust-clippy/issues/13160>" | ||||
| )] | ||||
| impl Default for SpritePlugin { | ||||
|     fn default() -> Self { | ||||
|         Self { | ||||
|  | ||||
| @ -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<M: Material2d>( | ||||
|     opaque_draw_functions: Res<DrawFunctions<Opaque2d>>, | ||||
|     alpha_mask_draw_functions: Res<DrawFunctions<AlphaMask2d>>, | ||||
|  | ||||
| @ -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<RenderDevice>, | ||||
|  | ||||
| @ -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<Assets<Wireframe2dMaterial>>, | ||||
|     mut colors_changed: Query< | ||||
|  | ||||
| @ -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)>, | ||||
|  | ||||
| @ -494,7 +494,10 @@ pub struct ImageBindGroups { | ||||
|     values: HashMap<AssetId<Image>, 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<FixedBitSet>, | ||||
|     draw_functions: Res<DrawFunctions<Transparent2d>>, | ||||
| @ -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<RenderDevice>, | ||||
| @ -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<usize>, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 MichiRecRoom
						MichiRecRoom