Skip to content

Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml #17374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
40cf20b
Move `#![warn(clippy::allow_attributes, clippy::allow_attributes_with…
LikeLakers2 Jan 14, 2025
826fc52
Apply `#![allow(clippy::allow_attributes, clippy::allow_attributes_wi…
LikeLakers2 Jan 14, 2025
aad3b7f
Forgot to put these under `[lints.clippy]` too
LikeLakers2 Jan 14, 2025
0520e5a
Apply the attributes to the benches too
LikeLakers2 Jan 14, 2025
83750f5
Fix-up `src\lib.rs`
LikeLakers2 Jan 14, 2025
1d7dfd0
Fix-up `benches\benches\bevy_ecs\components\add_remove_very_big_table…
LikeLakers2 Jan 14, 2025
d05e772
Fix-up `crates\bevy_ecs\examples\*.rs`
LikeLakers2 Jan 14, 2025
7e486b7
Fix-up `examples\stress_tests\many_components.rs`
LikeLakers2 Jan 14, 2025
af267d9
Fix-up `examples\ecs\dynamic.rs`
LikeLakers2 Jan 14, 2025
7ff8867
Fix-up `examples\ecs\immutable_components.rs`
LikeLakers2 Jan 14, 2025
8f9cb90
Fix-up `examples\math\render_primitives.rs`
LikeLakers2 Jan 14, 2025
c43a8d5
Fix-up `examples\stress_tests\transform_hierarchy.rs`
LikeLakers2 Jan 14, 2025
ea816dd
Fix-up `examples\asset\processing\asset_processing.rs`
LikeLakers2 Jan 14, 2025
8cfbecc
Fix-up `examples\asset\custom_asset.rs`
LikeLakers2 Jan 14, 2025
6361c65
Fix-up `examples\reflection\reflection_types.rs`
LikeLakers2 Jan 14, 2025
b31cc70
Appease the almighty `rustfmt`
LikeLakers2 Jan 14, 2025
df9e1cd
forgot this bit
LikeLakers2 Jan 14, 2025
4e80c81
Update benches/benches/bevy_ecs/components/add_remove_very_big_table.rs
LikeLakers2 Jan 14, 2025
8dc3033
Implement requested changes
LikeLakers2 Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ std_instead_of_core = "warn"
std_instead_of_alloc = "warn"
alloc_instead_of_core = "warn"

allow_attributes = "warn"
allow_attributes_without_reason = "warn"

[workspace.lints.rust]
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
Expand Down Expand Up @@ -95,6 +98,9 @@ std_instead_of_core = "allow"
std_instead_of_alloc = "allow"
alloc_instead_of_core = "allow"

allow_attributes = "warn"
allow_attributes_without_reason = "warn"

[lints.rust]
missing_docs = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
Expand Down
3 changes: 3 additions & 0 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ ref_as_ptr = "warn"
# see: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366966219
too_long_first_doc_paragraph = "allow"

allow_attributes = "warn"
allow_attributes_without_reason = "warn"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
unsafe_op_in_unsafe_fn = "warn"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![allow(dead_code)]
#![expect(
dead_code,
reason = "The `Mat4`s in the structs are used to bloat the size of the structs for benchmarking purposes."
)]

use bevy_ecs::prelude::*;
use glam::*;
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_a11y/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![forbid(unsafe_code)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@
//! This trait mirrors [`AssetLoader`] in structure, and works in tandem with [`AssetWriter`](io::AssetWriter), which mirrors [`AssetReader`](io::AssetReader).

#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_audio/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![forbid(unsafe_code)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_color/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_core_pipeline/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![forbid(unsafe_code)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_dev_tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_diagnostic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_dylib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(
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"
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_ecs/examples/change_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
//! To demonstrate change detection, there are some console outputs based on changes in
//! the `EntityCounter` resource and updated Age components

#![expect(clippy::std_instead_of_core)]
#![expect(
clippy::std_instead_of_core,
reason = "Examples should not follow this lint"
)]

use bevy_ecs::prelude::*;
use rand::Rng;
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_ecs/examples/resources.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! In this example we add a counter resource and increase its value in one system,
//! while a different system prints the current count to the console.

#![expect(clippy::std_instead_of_core)]
#![expect(
clippy::std_instead_of_core,
reason = "Examples should not follow this lint"
)]

use bevy_ecs::prelude::*;
use rand::Rng;
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
)]
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
#![expect(unsafe_code, reason = "Unsafe code is used to improve performance.")]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_gilrs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_gizmos/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_gltf/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_hierarchy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_image/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]

extern crate alloc;

Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_input/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_input_focus/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_internal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_log/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_macro_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![forbid(unsafe_code)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_math/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![forbid(unsafe_code)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(
any(docsrs, docsrs_dep),
expect(
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_mesh/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]

extern crate alloc;
extern crate core;
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_mikktspace/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![allow(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "Much of the code here is still code that's been transpiled from C; we want to save 'fixing' this crate until after it's ported to safe rust."
)]
#![allow(
unsafe_op_in_unsafe_fn,
clippy::all,
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_pbr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![forbid(unsafe_code)]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_picking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@
//! the plugin with arbitrary backends and input methods, yet still use all the high level features.

#![deny(missing_docs)]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]

extern crate alloc;

Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_ptr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
#![no_std]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![expect(unsafe_code, reason = "Raw pointers are inherently unsafe.")]
#![warn(
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"
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_reflect/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(
any(docsrs, docsrs_dep),
expect(
Expand Down
6 changes: 0 additions & 6 deletions crates/bevy_remote/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,6 @@
//! [fully-qualified type names]: bevy_reflect::TypePath::type_path
//! [fully-qualified type name]: bevy_reflect::TypePath::type_path

#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]

use async_channel::{Receiver, Sender};
use bevy_app::{prelude::*, MainScheduleOrder};
use bevy_derive::{Deref, DerefMut};
Expand Down
5 changes: 0 additions & 5 deletions crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
#![expect(unsafe_code, reason = "Unsafe code is used to improve performance.")]
#![warn(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![cfg_attr(
any(docsrs, docsrs_dep),
expect(
Expand Down
Loading
Loading