Skip to content

Commit f21125c

Browse files
LikeLakers2mrchantey
authored andcommitted
bevy_input: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (bevyengine#17242)
# Objective - bevyengine#17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_input` in line with the new restrictions. ## Testing `cargo clippy --tests --package bevy_input` was run, and no errors were encountered.
1 parent 9e22b39 commit f21125c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

crates/bevy_input/src/keyboard.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ pub enum NativeKeyCode {
238238
all(feature = "serialize", feature = "bevy_reflect"),
239239
reflect(Serialize, Deserialize)
240240
)]
241-
#[allow(clippy::doc_markdown)] // Clippy doesn't like our use of <kbd>.
241+
#[expect(
242+
clippy::doc_markdown,
243+
reason = "We use camel-case words inside `<kbd>` tags to represent keyboard keys, which are not identifiers that we should be putting inside backticks."
244+
)]
242245
#[repr(u32)]
243246
pub enum KeyCode {
244247
/// This variant is used when the key cannot be translated to any other variant.
@@ -764,7 +767,10 @@ pub enum NativeKey {
764767
all(feature = "serialize", feature = "bevy_reflect"),
765768
reflect(Serialize, Deserialize)
766769
)]
767-
#[allow(clippy::doc_markdown)] // Clippy doesn't like our use of <kbd>.
770+
#[expect(
771+
clippy::doc_markdown,
772+
reason = "We use camel-case words inside `<kbd>` tags to represent keyboard keys, which are not identifiers that we should be putting inside backticks."
773+
)]
768774
pub enum Key {
769775
/// A key string that corresponds to the character typed by the user, taking into account the
770776
/// user’s current locale setting, and any system-level keyboard mapping overrides that are in

crates/bevy_input/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![forbid(unsafe_code)]
3+
#![deny(
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+
)]
38
#![doc(
49
html_logo_url = "https://bevyengine.org/assets/icon.png",
510
html_favicon_url = "https://bevyengine.org/assets/icon.png"

0 commit comments

Comments
 (0)