-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
bevy_ui: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17229
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
bevy_ui: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)]
#17229
Conversation
425d98e to
95d4ba2
Compare
…butes_without_reason)]` to bevy_ui
95d4ba2 to
33e311b
Compare
| #[allow(unreachable_code)] | ||
| #[expect( | ||
| unreachable_code, | ||
| reason = "Certain pieces of code tested here cause the test to fail if made reachable; see #17231 for progress on fixing this" | ||
| )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not proficient enough in bevy_ui to know if we should merge these expects that I added to crates/bevy_ui/src/layout/ui_surface.rs, or if we should wait until #17231 is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was informed that there's already a PR for this: #16362
StrikeForceZero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case you missed it from the last CI run
error: #[allow] attribute found
--> crates/bevy_ui/src/render/debug_overlay.rs:57:3
|
57 | #[allow(clippy::too_many_arguments)]
| ^^^^^ help: replace it with: `expect`
error: `allow` attribute without specifying a reason
--> crates/bevy_ui/src/render/debug_overlay.rs:57:1
|
57 | #[allow(clippy::too_many_arguments)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a reason at the end with `, reason = ".."`
Excluding my other comment and the above, everything looks good to me.
|
@StrikeForceZero I indeed missed it - because I intentionally ignored CI, thinking the errors were going to be about the I'll get it later today, as I can't check whether those need to be removed or replaced with |
|
Marked as ready for review per @alice-i-cecile - because whether my my PR is merged first, or @StrikeForceZero's PR is merged first, the other will have a minor merge conflict. |
…butes_without_reason)]` (bevyengine#17229) # Objective - bevyengine#17111 ## Solution Set the `clippy::allow_attributes` and `clippy::allow_attributes_without_reason` lints to `deny`, and bring `bevy_ui` in line with the new restrictions. ## Testing `cargo clippy --tests` and `cargo test --package bevy_ui` were run, and no errors were encountered.
Objective
clippy::allow_attributesandclippy::allow_attributes_without_reasonlints #17111Solution
Set the
clippy::allow_attributesandclippy::allow_attributes_without_reasonlints todeny, and bringbevy_uiin line with the new restrictions.Testing
cargo clippy --testsandcargo test --package bevy_uiwere run, and no errors were encountered.