Skip to content

Release linter v0.3.0#392

Merged
BD103 merged 10 commits intomainfrom
linter-v0.3.0
Apr 30, 2025
Merged

Release linter v0.3.0#392
BD103 merged 10 commits intomainfrom
linter-v0.3.0

Conversation

@BD103
Copy link
Copy Markdown
Member

@BD103 BD103 commented Apr 24, 2025

This PR prepares bevy_lint for v0.3.0, following the release guide. Once this is marked ready for review, this will need at least one approval from a Bevy maintainer and no outstanding concerns. Once this is merged, a feature freeze will be enacted until the post-release PR is merged.

Blockers

For Reviewers

Now is your chance to look through the docs, the changelog, and the migration guide to ensure everything is in working order. If you wish to test the linter, you may install it from this branch:

rustup toolchain install nightly-2025-04-03 \
    --component rustc-dev \
    --component llvm-tools-preview

rustup run nightly-2025-04-03 cargo install \
    --git https://github.com/TheBevyFlock/bevy_cli.git \
    --branch linter-v0.3.0 \
    --locked \
    bevy_lint

You're encouraged to run the linter on several projects to ensure it works correctly. Some good places to start include:

Thank you for all of your help!

Next Steps

@BD103 BD103 added A-Linter Related to the linter and custom lints S-Blocked This cannot move forward until something else changes labels Apr 24, 2025
@DaAlbrecht
Copy link
Copy Markdown
Collaborator

Tested on MacOS with the following config

[workspace.metadata.bevy_lint]
# on by default
correctness = "warn"
suspicious = "warn"
complexity = "warn"
performance = "warn"
# off by default
style = "warn"
restriction = "warn"
pedantic = "warn"

On these Repositories:

bevy:12f71a8936c77735b6f702b1ef849dfc8a306a37
bevy_new_2d:5b4314dc802ac9d09914b4ee4b519334f88f7b3f
janhohenheim/foxtrot:99ec0bbc335e18c11595d548e5ff20c8c6fd9828

Worked as expected with no ICE's

Just out of fun, the Lint output from:

[workspace.metadata.bevy_lint]
#enabled by default
correctness = "warn"
suspicious = "warn"
complexity = "warn"
performance = "warn"
# off by default
style = "warn"
panicking_methods = { level = "warn" }
pedantic = "warn"

lint_output.txt

Updated our dev dependencies, most importantly changed from the rc.2 to
"0.16.0" from bevy
@BD103 BD103 moved this to In Progress in BD103 Work Planning Apr 26, 2025
@BD103 BD103 moved this to This Week in BD103 Work Planning Apr 26, 2025
@BD103 BD103 removed the S-Blocked This cannot move forward until something else changes label Apr 26, 2025
@BD103 BD103 marked this pull request as ready for review April 28, 2025 14:18
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

unconventional_naming needs work. These should be split into distinct lints, so users can pick and choose more easily. The system set convention should also be changed, to match the style picked by @Jondolf for Bevy itself :)

The rest of this looks fine, although main_return_without_appexit confuses me a bit: why should this lint exist, rather than just being a must_use annotation upstream?

@DaAlbrecht
Copy link
Copy Markdown
Collaborator

unconventional_naming needs work. These should be split into distinct lints, so users can pick and choose more easily. The system set convention should also be changed to match the style picked by @Jondolf for Bevy itself :)

We have planned to support configuring the unconventional_naming lint like this in 0.4.0. Would you still rather have one lint per trait?

[package.metadata.bevy_lint]
unconventional_naming = { level = "warn", traits = ["SystemSet", "Plugin"] }

And for the system set convention, we switched to using FooSystems as @Jondolf suggested.

The rest of this looks fine, although main_return_without_appexit confuses me a bit: why should this lint exist, rather than just being a must_use annotation upstream?

I don't know the history, but I think that there were some attempts to do this: bevyengine/bevy#5395, bevyengine/bevy#11947, but that in the end it didn't work, so it sparked the idea for this lint?

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Apr 28, 2025

And for the system set convention, we switched to using FooSystems as @Jondolf suggested.

Yup! #384 was merged to fix this, but #387 merged at the same time and caused the docs to become outdated. I'll handle that in this PR.

The rest of this looks fine, although main_return_without_appexit confuses me a bit: why should this lint exist, rather than just being a must_use annotation upstream?

I don't know the history, but I think that there were some attempts to do this: bevyengine/bevy#5395, bevyengine/bevy#11947, but that in the end it didn't work, so it sparked the idea for this lint?

Exactly: a lint is configurable, #[must_use] isn't1. (And Cart pushed back against it, I think he disliked the extra warnings.) The name and implementation could probably be simplified, and it's at most a pedantic warning and not a real issue if people ignore AppExit.

Footnotes

  1. For context, #[must_used] was introduced to things like iterators to let developers know they were lazy and would not do anything without being iterated upon.

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Apr 28, 2025

#384 was merged to fix this, but #387 merged at the same time and caused the docs to become outdated.

I take this back, the docs and the implementation look correct. Is there something I'm missing? We decided on SystemSets ending in the suffix "Systems", correct?

@BD103 BD103 added S-Needs-Review The PR needs to be reviewed before it can be merged C-Docs An improvement in documentation labels Apr 28, 2025
@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Apr 29, 2025

Note that the "Test linter action" workflows are meant to fail, as the lint-v0.3.0 tags are not yet created.

@alice-i-cecile
Copy link
Copy Markdown
Member

#384 was merged to fix this, but #387 merged at the same time and caused the docs to become outdated.

I take this back, the docs and the implementation look correct. Is there something I'm missing? We decided on SystemSets ending in the suffix "Systems", correct?

I ended up looking at the linked PR, so I didn't see any corrections :)

Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Making the must_use configurable makes sense to me as a justification. And using config to split apart the lint seems like a great solution. That can wait; this LGTM now.

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Apr 29, 2025

Awesome, thank you so much! I'll merge this later today, once I have time to manage the release :)

@BD103 BD103 removed the S-Needs-Review The PR needs to be reviewed before it can be merged label Apr 30, 2025
@BD103 BD103 enabled auto-merge (squash) April 30, 2025 14:31
@BD103 BD103 merged commit 7005713 into main Apr 30, 2025
10 of 13 checks passed
@BD103 BD103 deleted the linter-v0.3.0 branch April 30, 2025 14:47
@github-project-automation github-project-automation bot moved this from This Week to Done in BD103 Work Planning Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Related to the linter and custom lints C-Docs An improvement in documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants