Deny the clippy::allow_attributes
and clippy::allow_attributes_without_reason
lints
#17111
Open
8 of 49 tasks
Labels
A-Cross-Cutting
Impacts the entire engine
C-Code-Quality
A section of code that is hard to understand or change
C-Tracking-Issue
An issue that collects information about a broad development initiative
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
This is a tracking issue for denying the
clippy::allow_attributes
andclippy::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#![deny(clippy::allow_attributes)]
, we can remove any 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: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 areason = "..."
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.
#![deny(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: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17093bevy_animation: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17094bevy_app: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17095bevy_asset: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17113bevy_audio: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17119bevy_color: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17090bevy_core_pipeline: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17137bevy_core_pipeline::core_2d::Camera2dBundle
#17185bevy_dev_tools: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17159bevy_diagnostic: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17186bevy_math: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17091bevy_reflect: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17092bevy_sprite: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
(Attempt 2) #17184bevy_tasks: Apply
#![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17089[workspace.lints.clippy]
in the rootCargo.toml
.The text was updated successfully, but these errors were encountered: