-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Enable clippy::undocumented_unsafe_blocks
warning across the workspace
#10646
Merged
alice-i-cecile
merged 9 commits into
bevyengine:main
from
13ros27:undocumented-unsafe-lint
Nov 21, 2023
Merged
Enable clippy::undocumented_unsafe_blocks
warning across the workspace
#10646
alice-i-cecile
merged 9 commits into
bevyengine:main
from
13ros27:undocumented-unsafe-lint
Nov 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…AFETY comment higher up which applies to this unsafe block as well
… comment anyway?)
… are but I'm not 100% sure
…_render` to be sure (or give more detail), also reduced the unsafe block to make it clear what function call is unsafe
…ce lints and ignored it in mikktspace
…e it is now workspace-wide
alice-i-cecile
added
A-Build-System
Related to build systems or continuous integration
C-Code-Quality
A section of code that is hard to understand or change
labels
Nov 19, 2023
alice-i-cecile
approved these changes
Nov 20, 2023
killercup
approved these changes
Nov 20, 2023
alice-i-cecile
added
the
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
label
Nov 20, 2023
github-merge-queue
bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 21, 2023
rdrpenguin04
pushed a commit
to rdrpenguin04/bevy
that referenced
this pull request
Jan 9, 2024
…ace (bevyengine#10646) # Objective Enables warning on `clippy::undocumented_unsafe_blocks` across the workspace rather than only in `bevy_ecs`, `bevy_transform` and `bevy_utils`. This adds a little awkwardness in a few areas of code that have trivial safety or explain safety for multiple unsafe blocks with one comment however automatically prevents these comments from being missed. ## Solution This adds `undocumented_unsafe_blocks = "warn"` to the workspace `Cargo.toml` and fixes / adds a few missed safety comments. I also added `#[allow(clippy::undocumented_unsafe_blocks)]` where the safety is explained somewhere above. There are a couple of safety comments I added I'm not 100% sure about in `bevy_animation` and `bevy_render/src/view` and I'm not sure about the use of `#[allow(clippy::undocumented_unsafe_blocks)]` compared to adding comments like `// SAFETY: See above`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Build-System
Related to build systems or continuous integration
C-Code-Quality
A section of code that is hard to understand or change
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Enables warning on
clippy::undocumented_unsafe_blocks
across the workspace rather than only inbevy_ecs
,bevy_transform
andbevy_utils
. This adds a little awkwardness in a few areas of code that have trivial safety or explain safety for multiple unsafe blocks with one comment however automatically prevents these comments from being missed.Solution
This adds
undocumented_unsafe_blocks = "warn"
to the workspaceCargo.toml
and fixes / adds a few missed safety comments. I also added#[allow(clippy::undocumented_unsafe_blocks)]
where the safety is explained somewhere above.There are a couple of safety comments I added I'm not 100% sure about in
bevy_animation
andbevy_render/src/view
and I'm not sure about the use of#[allow(clippy::undocumented_unsafe_blocks)]
compared to adding comments like// SAFETY: See above
.