-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
This is a tracking issue for warning on the clippy::allow_attributes
and clippy::allow_attributes_without_reason
lints across all bevy crates.
What are these?
clippy::allow_attributes
This lints against any instances of #[allow(...)]
, suggesting they be changed to #[expect(...)]
.
The use case for this is to avoid letting #[allow(...)]
s pile up within Bevy's database, especially since #[expect(...)]
is now available. By using #![warn(clippy::allow_attributes)]
, we can remove any unnecessary instances of #[allow(...)]
.
Do note that it's not possible to forbid this lint - there are instances where we are forced to #[allow(...)]
, as the lints may not always be triggered (such as in macros for tuples).
Notably, this does not lint against #![allow(...)]
(notice the !
), per the lint's description:
This lint only warns outer attributes (
#[allow]
), as inner attributes (#![allow]
) are usually used to enable or disable lints on a global scale.
However, I will make an attempt to look for instances of #![allow(...)]
anyways... if I remember.
See also:
https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes
clippy::allow_attributes_without_reason
This lints against any instances of #[allow(...)]
or #[expect(...)]
that do not include a reason = "..."
field.
This ensures that if an expect or allow is used, it is given a reason - which helps to document why it's there in the first place.
Notably, this does not lint against #[warn(...)]
or #[deny(...)]
.
See also:
https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
Checklist
PRs marked as drafts in the list below mean that something (i.e. another PR) blocking them. Once the blocking PRs are merged, each applicable PR will be updated to fix any conflicts, and marked as ready to merge.
- For each Bevy crate, create a PR where we add
#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
to the root, and modify the rest of the crate as necessary to fulfill these new restrictions.- bevy_a11y
bevy_a11y: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17093 - bevy_animation
bevy_animation: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17094 - bevy_app
bevy_app: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17095 - bevy_asset
bevy_asset: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17113 - bevy_audio
bevy_audio: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17119 - bevy_color
bevy_color: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17090 - bevy_core_pipeline
bevy_core_pipeline: Apply#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17137 - bevy_dev_tools
bevy_dev_tools: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17159 - bevy_diagnostic
bevy_diagnostic: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17186 - bevy_dylib
bevy_dylib: Apply#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17332 - bevy_ecs
bevy_ecs: Apply#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17335 - bevy_gilrs
bevy_gilrs: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17245 - bevy_gizmos
bevy_gizmos: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17281 - bevy_gltf
bevy_gltf: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17280 - bevy_hierarchy
bevy_hierarchy: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17286 - bevy_image
bevy_image: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17289 - bevy_input
bevy_input: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17242 - bevy_input_focus
bevy_input_focus: Apply#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17323 - bevy_internal
bevy_internal: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17306 - bevy_log
bevy_log: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17246 - bevy_macro_utils
bevy_macro_utils: Apply#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17304 - bevy_math
bevy_math: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17091 - bevy_mesh
bevy_mesh: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17218 - bevy_mikktspace
- bevy_pbr
bevy_pbr: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17277 - bevy_picking
bevy_picking: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17302 - bevy_ptr
bevy_ptr: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17214 - bevy_reflect
bevy_reflect: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17092 - bevy_remote
bevy_remote: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17303 - bevy_render
bevy_render: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17194 - bevy_scene
bevy_scene: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17278 - bevy_sprite
bevy_sprite: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
(Attempt 2) #17184 - bevy_state
bevy_state: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17288 - bevy_tasks
bevy_tasks: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17089 - bevy_text
bevy_text: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17285 - bevy_time
bevy_time: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17210 - bevy_transform
bevy_transform: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17284 - bevy_ui
bevy_ui: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17229 - bevy_utils
bevy_utils: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17305 - bevy_window
bevy_window: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17213 - bevy_winit
bevy_winit: Apply#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17232
- bevy_a11y
- Make a final PR where we remove the lint attributes from each crate, and move them under
[workspace.lints.clippy]
in the rootCargo.toml
.
Move#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
to the workspaceCargo.toml
#17374