Skip to content

Commit 26bb0b4

Browse files
Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374)
# Objective Fixes #17111 ## Solution Move `#![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)]` to the workspace `Cargo.toml` ## Testing Lots of CI testing, and local testing too. --------- Co-authored-by: Benjamin Brienen <[email protected]>
1 parent 0756a19 commit 26bb0b4

File tree

55 files changed

+73
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+73
-221
lines changed

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ std_instead_of_core = "warn"
5454
std_instead_of_alloc = "warn"
5555
alloc_instead_of_core = "warn"
5656

57+
allow_attributes = "warn"
58+
allow_attributes_without_reason = "warn"
59+
5760
[workspace.lints.rust]
5861
missing_docs = "warn"
5962
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
@@ -95,6 +98,9 @@ std_instead_of_core = "allow"
9598
std_instead_of_alloc = "allow"
9699
alloc_instead_of_core = "allow"
97100

101+
allow_attributes = "warn"
102+
allow_attributes_without_reason = "warn"
103+
98104
[lints.rust]
99105
missing_docs = "warn"
100106
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }

benches/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ ref_as_ptr = "warn"
5656
# see: https://github.com/bevyengine/bevy/pull/15375#issuecomment-2366966219
5757
too_long_first_doc_paragraph = "allow"
5858

59+
allow_attributes = "warn"
60+
allow_attributes_without_reason = "warn"
61+
5962
[lints.rust]
6063
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docsrs_dep)'] }
6164
unsafe_op_in_unsafe_fn = "warn"

benches/benches/bevy_ecs/components/add_remove_very_big_table.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#![allow(dead_code)]
1+
#![expect(
2+
dead_code,
3+
reason = "The `Mat4`s in the structs are used to bloat the size of the structs for benchmarking purposes."
4+
)]
25

36
use bevy_ecs::prelude::*;
47
use glam::*;

crates/bevy_a11y/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![forbid(unsafe_code)]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_animation/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_app/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
)]
88
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
99
#![forbid(unsafe_code)]
10-
#![warn(
11-
clippy::allow_attributes,
12-
clippy::allow_attributes_without_reason,
13-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
14-
)]
1510
#![doc(
1611
html_logo_url = "https://bevyengine.org/assets/icon.png",
1712
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_asset/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@
139139
//! This trait mirrors [`AssetLoader`] in structure, and works in tandem with [`AssetWriter`](io::AssetWriter), which mirrors [`AssetReader`](io::AssetReader).
140140
141141
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
142-
#![warn(
143-
clippy::allow_attributes,
144-
clippy::allow_attributes_without_reason,
145-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
146-
)]
147142
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
148143
#![doc(
149144
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_audio/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![forbid(unsafe_code)]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_color/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_core_pipeline/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
94
#![doc(
105
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_dev_tools/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_diagnostic/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
22
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
33
#![forbid(unsafe_code)]
4-
#![warn(
5-
clippy::allow_attributes,
6-
clippy::allow_attributes_without_reason,
7-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
8-
)]
94
#![doc(
105
html_logo_url = "https://bevyengine.org/assets/icon.png",
116
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_dylib/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![doc(
83
html_logo_url = "https://bevyengine.org/assets/icon.png",
94
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_ecs/examples/change_detection.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
//! To demonstrate change detection, there are some console outputs based on changes in
77
//! the `EntityCounter` resource and updated Age components
88
9-
#![expect(clippy::std_instead_of_core)]
9+
#![expect(
10+
clippy::std_instead_of_core,
11+
reason = "Examples should not follow this lint"
12+
)]
1013

1114
use bevy_ecs::prelude::*;
1215
use rand::Rng;

crates/bevy_ecs/examples/resources.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! In this example we add a counter resource and increase its value in one system,
22
//! while a different system prints the current count to the console.
33
4-
#![expect(clippy::std_instead_of_core)]
4+
#![expect(
5+
clippy::std_instead_of_core,
6+
reason = "Examples should not follow this lint"
7+
)]
58

69
use bevy_ecs::prelude::*;
710
use rand::Rng;

crates/bevy_ecs/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
)]
2020
#![cfg_attr(any(docsrs, docsrs_dep), feature(doc_auto_cfg, rustdoc_internals))]
2121
#![expect(unsafe_code, reason = "Unsafe code is used to improve performance.")]
22-
#![warn(
23-
clippy::allow_attributes,
24-
clippy::allow_attributes_without_reason,
25-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
26-
)]
2722
#![doc(
2823
html_logo_url = "https://bevyengine.org/assets/icon.png",
2924
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_gilrs/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_gizmos/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![doc(
83
html_logo_url = "https://bevyengine.org/assets/icon.png",
94
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_gltf/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_hierarchy/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_image/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72

83
extern crate alloc;
94

crates/bevy_input/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_input_focus/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_internal/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",
105
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_log/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![doc(
83
html_logo_url = "https://bevyengine.org/assets/icon.png",
94
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_macro_utils/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![forbid(unsafe_code)]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
83
#![doc(
94
html_logo_url = "https://bevyengine.org/assets/icon.png",

crates/bevy_math/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![forbid(unsafe_code)]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![cfg_attr(
83
any(docsrs, docsrs_dep),
94
expect(

crates/bevy_mesh/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72

83
extern crate alloc;
94
extern crate core;

crates/bevy_mikktspace/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#![allow(
2+
clippy::allow_attributes,
3+
clippy::allow_attributes_without_reason,
4+
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."
5+
)]
16
#![allow(
27
unsafe_op_in_unsafe_fn,
38
clippy::all,

crates/bevy_pbr/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
22
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
33
#![forbid(unsafe_code)]
4-
#![warn(
5-
clippy::allow_attributes,
6-
clippy::allow_attributes_without_reason,
7-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
8-
)]
94
#![doc(
105
html_logo_url = "https://bevyengine.org/assets/icon.png",
116
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_picking/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@
155155
//! the plugin with arbitrary backends and input methods, yet still use all the high level features.
156156
157157
#![deny(missing_docs)]
158-
#![warn(
159-
clippy::allow_attributes,
160-
clippy::allow_attributes_without_reason,
161-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
162-
)]
163158

164159
extern crate alloc;
165160

crates/bevy_ptr/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
#![no_std]
33
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
44
#![expect(unsafe_code, reason = "Raw pointers are inherently unsafe.")]
5-
#![warn(
6-
clippy::allow_attributes,
7-
clippy::allow_attributes_without_reason,
8-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
9-
)]
105
#![doc(
116
html_logo_url = "https://bevyengine.org/assets/icon.png",
127
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_reflect/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2-
#![warn(
3-
clippy::allow_attributes,
4-
clippy::allow_attributes_without_reason,
5-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
6-
)]
72
#![cfg_attr(
83
any(docsrs, docsrs_dep),
94
expect(

crates/bevy_remote/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,6 @@
318318
//! [fully-qualified type names]: bevy_reflect::TypePath::type_path
319319
//! [fully-qualified type name]: bevy_reflect::TypePath::type_path
320320
321-
#![warn(
322-
clippy::allow_attributes,
323-
clippy::allow_attributes_without_reason,
324-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
325-
)]
326-
327321
use async_channel::{Receiver, Sender};
328322
use bevy_app::{prelude::*, MainScheduleOrder};
329323
use bevy_derive::{Deref, DerefMut};

crates/bevy_render/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
22
#![expect(unsafe_code, reason = "Unsafe code is used to improve performance.")]
3-
#![warn(
4-
clippy::allow_attributes,
5-
clippy::allow_attributes_without_reason,
6-
reason = "See #17111; To be removed once all crates are in-line with these attributes"
7-
)]
83
#![cfg_attr(
94
any(docsrs, docsrs_dep),
105
expect(

0 commit comments

Comments
 (0)