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

Enable clippy::undocumented_unsafe_blocks warning across the workspace #10646

Merged
merged 9 commits into from
Nov 21, 2023

Conversation

13ros27
Copy link
Contributor

@13ros27 13ros27 commented Nov 19, 2023

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.

@alice-i-cecile 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 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
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 21, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 21, 2023
Merged via the queue into bevyengine:main with commit e67cfdf Nov 21, 2023
26 checks passed
@13ros27 13ros27 deleted the undocumented-unsafe-lint branch November 21, 2023 19:53
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants