Skip to content
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_audio: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] #17119

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LikeLakers2
Copy link
Contributor

Objective

Solution

Set the clippy::allow_attributes and clippy::allow_attributes_without_reason lints to deny, and bring bevy_audio in line with the new restrictions.

No code changes have been made - except if a lint that was previously allow(...)'d could be removed via small code changes. For example, unused_variables can be handled by adding a _ to the beginning of a field's name.

Testing

cargo clippy and cargo test --package bevy_audio were run, and no errors were encountered.

@LikeLakers2 LikeLakers2 force-pushed the lint/deny_allow_and_without_reason/bevy_audio branch from 7d7dc73 to 90e53b4 Compare January 3, 2025 10:37
Copy link
Contributor Author

@LikeLakers2 LikeLakers2 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna be honest: I have NO idea what's happening with rustc's linter in this file. It's marking a deprecated item's definition as a use of a deprecated item, and it's marking the impls for that deprecated item as a use of that deprecated item.

But I tried my best to silence the lints, while simultaneously changing all allows to expects, and giving them all reason = "...".

So I hope the comment atop AudioSourceBundle and the module-wide expect are okay. They were the best I could do without straight-up removing the struct - which, frankly, I'm not sure if that's a good idea in the middle of 0.15.

Copy link
Contributor Author

@LikeLakers2 LikeLakers2 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've figured it out - it's the #[derive(Bundle)] placed atop AudioSourceBundle. I've updated the comment atop AudioSourceBundle to reflect these findings.

I consider this to be a rustc issue, and hence don't want to try to change the Bundle derive to include #[allow(deprecated)]. However, I have written a bug report for this:

@BenjaminBrienen
Copy link
Contributor

I disagree with your interpretation of rustc's deprecation behavior. An impl is a usage. I think this should be blocked on #16338, which would clean-up this changeset.

@BenjaminBrienen BenjaminBrienen added D-Trivial Nice and easy! A great choice to get started with Bevy A-Audio Sounds playback and modification S-Blocked This cannot move forward until something else changes S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Code-Quality A section of code that is hard to understand or change labels Jan 3, 2025
@LikeLakers2
Copy link
Contributor Author

LikeLakers2 commented Jan 3, 2025

@BenjaminBrienen Ok. Just notify me when that PR is merged and I'll update this PR.

@LikeLakers2 LikeLakers2 changed the title bevy_audio: Apply #[deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] bevy_audio: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] Jan 4, 2025
@LikeLakers2 LikeLakers2 marked this pull request as draft January 5, 2025 10:33
@LikeLakers2
Copy link
Contributor Author

This PR is blocked on #16338 per Benjamin's request. Once that is merged, I will fix any conflicts and mark it as ready to merge.

@LikeLakers2 LikeLakers2 marked this pull request as ready for review January 6, 2025 07:51
@IQuick143 IQuick143 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Blocked This cannot move forward until something else changes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Audio Sounds playback and modification C-Code-Quality A section of code that is hard to understand or change D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants