Skip to content

bevy_sprite: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] #17160

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

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_sprite were run, and no errors were encountered.

@LikeLakers2
Copy link
Contributor Author

LikeLakers2 commented Jan 5, 2025

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.

@IQuick143 IQuick143 added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change S-Blocked This cannot move forward until something else changes D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Jan 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 5, 2025
…unused variables, rather than putting underscores on the parameter names (#17171)

# Objective
While checking over #17160, it
occurred to me that rust-analyzer will copy the method signature
exactly, when using tab completion trait methods. This includes provided
trait methods that use underscores to silence the `unused_variables`
lint. This probably isn't good for users, seeing as how they'll have to
remove the underscore if they want to use the parameters.

(I mean, they technically don't have to remove the underscore... but
usually you don't keep a leading underscore on parameters you're using.)

## Solution
Changes `bevy_reflect::RegisterForReflection::__register()` to
`#[expect(unused_variables)]`, and removes the underscores from its
parameter names.

## Testing
N/A
@LikeLakers2
Copy link
Contributor Author

I broke the history in a weird way. I'm going to re-make this PR as a new PR.

@LikeLakers2 LikeLakers2 closed this Jan 6, 2025
@LikeLakers2 LikeLakers2 deleted the lint/deny_allow_and_without_reason/bevy_sprite branch January 6, 2025 07:06
Copy link
Contributor

github-actions bot commented Jan 6, 2025

Your PR increases Bevy Minimum Supported Rust Version. Please update the rust-version field in the root Cargo.toml file.

github-merge-queue bot pushed a commit that referenced this pull request Jan 6, 2025
…ttributes_without_reason)]` (Attempt 2) (#17184)

I broke the commit history on the other one,
#17160. Woops.

# Objective
- #17111

## Solution
Set the `clippy::allow_attributes` and
`clippy::allow_attributes_without_reason` lints to `deny`, and bring
`bevy_sprite` in line with the new restrictions.

## Testing
`cargo clippy` and `cargo test --package bevy_sprite` were run, and no
errors were encountered.
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
…unused variables, rather than putting underscores on the parameter names (bevyengine#17171)

# Objective
While checking over bevyengine#17160, it
occurred to me that rust-analyzer will copy the method signature
exactly, when using tab completion trait methods. This includes provided
trait methods that use underscores to silence the `unused_variables`
lint. This probably isn't good for users, seeing as how they'll have to
remove the underscore if they want to use the parameters.

(I mean, they technically don't have to remove the underscore... but
usually you don't keep a leading underscore on parameters you're using.)

## Solution
Changes `bevy_reflect::RegisterForReflection::__register()` to
`#[expect(unused_variables)]`, and removes the underscores from its
parameter names.

## Testing
N/A
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
…ttributes_without_reason)]` (Attempt 2) (bevyengine#17184)

I broke the commit history on the other one,
bevyengine#17160. Woops.

# Objective
- bevyengine#17111

## Solution
Set the `clippy::allow_attributes` and
`clippy::allow_attributes_without_reason` lints to `deny`, and bring
`bevy_sprite` in line with the new restrictions.

## Testing
`cargo clippy` and `cargo test --package bevy_sprite` were run, and no
errors were encountered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Blocked This cannot move forward until something else changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants