-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add Clippy like lint groups #16464
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
Merged
Merged
Add Clippy like lint groups #16464
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1eacf34
feat: Add clippy stlye lint groups
Muscraft 8b21295
refactor(lints): Replace groups with a primary group
Muscraft 5f96e45
refactor(lints): Make lints use their primary group's default level
Muscraft 87b1b44
refactor: Remove lint group edition configuration
Muscraft 085d9d1
feat: Add documentation for lint groups
Muscraft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,20 @@ | |
|
|
||
| Note: [Cargo's linting system is unstable](unstable.md#lintscargo) and can only be used on nightly toolchains | ||
|
|
||
|
|
||
|
|
||
| | Group | Description | Default level | | ||
| |----------------------|------------------------------------------------------------------|---------------| | ||
| | `cargo::complexity` | code that does something simple but in a complex way | warn | | ||
| | `cargo::correctness` | code that is outright wrong or useless | deny | | ||
| | `cargo::nursery` | new lints that are still under development | allow | | ||
| | `cargo::pedantic` | lints which are rather strict or have occasional false positives | allow | | ||
| | `cargo::perf` | code that can be written to run faster | warn | | ||
| | `cargo::restriction` | lints which prevent the use of Cargo features | allow | | ||
| | `cargo::style` | code that should be written in a more idiomatic way | warn | | ||
| | `cargo::suspicious` | code that is most likely wrong or useless | warn | | ||
|
Comment on lines
+7
to
+16
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Anyway, this is fine when being as a nightly feature. we need to revisit when stabilization. |
||
|
|
||
|
|
||
| ## Allowed-by-default | ||
|
|
||
| These lints are all set to the 'allow' level by default. | ||
|
|
@@ -14,7 +28,9 @@ These lints are all set to the 'warn' level by default. | |
| - [`unknown_lints`](#unknown_lints) | ||
|
|
||
| ## `blanket_hint_mostly_unused` | ||
| Set to `warn` by default | ||
| Group: `suspicious` | ||
|
|
||
| Level: `warn` | ||
|
|
||
| ### What it does | ||
| Checks if `hint-mostly-unused` being applied to all dependencies. | ||
|
|
@@ -42,7 +58,9 @@ hint-mostly-unused = true | |
|
|
||
|
|
||
| ## `implicit_minimum_version_req` | ||
| Set to `allow` by default | ||
| Group: `pedantic` | ||
|
|
||
| Level: `allow` | ||
|
|
||
| ### What it does | ||
|
|
||
|
|
@@ -91,7 +109,9 @@ serde = "1.0.219" | |
|
|
||
|
|
||
| ## `unknown_lints` | ||
| Set to `warn` by default | ||
| Group: `suspicious` | ||
|
|
||
| Level: `warn` | ||
|
|
||
| ### What it does | ||
| Checks for unknown lints in the `[lints.cargo]` table | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit unsure whether we want to have
cargo::all.clippy::allis not a real "all" (it includes only all lints that are on by default). So sometimes the name is a bit surprising. Anyhow, this is not a blocker for this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should not mirror
clippy::all