Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
After testing (
|
bas-ie
reviewed
Sep 24, 2024
Comment on lines
+54
to
+56
| /// These are designed for scenarios where you want to increase the consistency of your code-base | ||
| /// and reject certain patterns. They should not all be enabled at once, but instead specific lints | ||
| /// should be individually enabled. |
Collaborator
There was a problem hiding this comment.
I feel like the obvious question is, "if they shouldn't all be enabled at once, why are they in a group"? Or are we saying, this group is for categorising but not for actual use 🤔
Member
Author
There was a problem hiding this comment.
I want every lint to be within a group so that it's clear what its general purpose is. These lint groups are just as important for documentation as they are for bulk-toggling.
So yes, this group is a category that's never intended to be named directly. (Clippy has the same things!)
Co-authored-by: Rich Churcher <rich.churcher@gmail.com>
bas-ie
approved these changes
Sep 24, 2024
Collaborator
bas-ie
left a comment
There was a problem hiding this comment.
Somehow failed to approve first time around.
Collaborator
|
Oh, I'm not on the repo so doesn't matter! 😁 |
BD103
added a commit
that referenced
this pull request
Sep 25, 2024
Looks like I forgot to register the lint groups introduced in #98. Whoops! While I'm at it, I also changed the visibility of some items so that less is public that before.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #90.
This PR implements lint groups! These, just like Clippy's groups, allow enabling and disable multiple lints at a time based on their categories. I, stealing Clippy's groups, have added:
whileyou wrote there could be aforloop! (This category checks for overly-complex code with good alternatives.)std::thread::sleep(), that's your own fault.)Reflect.bevy_linthasn't been released yet!As part of this PR, I've changed a few things about how lints are defined.
declare_bevy_lint!macro. This is very similar to thedeclare_tool_lint!that we've used before.BevyLintstruct: contains theLintstruct and a reference to the lint group this is a member of.LintGroupstruct: represents the name and default level (deny, warn, allow) of a lint.Old comment about an error I fixed
As of yet I'm unable to actually deny / allow a lint group. I've tried:
But I'm getting:
main_return_without_appexitshould have been denied as an error, but it was a warning instead. This requires a bit more testing before it can be merged.