-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixes #9677 - Lint against mod lib; #9708
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) soon. Please see the contribution instructions for more information. |
clippy_lints/src/mod_lib.rs
Outdated
} | ||
declare_lint_pass!(ModLib => [MOD_LIB]); | ||
|
||
impl EarlyLintPass for ModLib { |
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.
Hey, thanks for working on this! I know this PR isn’t ready for review, just wanted to say we’re trying to make all new lints to use ‘LateLintPass’, cheers! Feel free to share any of your issues
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.
Thanks @kraktus I've updated the code to implement LateLintPass
instead. Am I going in the right direction here?
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.
It does! Looks like your lint is not registered yet, using cargo new_lint
(don’t remember the exact name of the subcommand, find it with cargo —help
while in clippy repo, will create the skeleton of the lint for you
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.
Actually cargo dev update_lint
should suffice in the current situation. The lint exists, but it isn't yet registered.
#![allow(unused)] | ||
#![warn(clippy::mod_lib)] | ||
|
||
mod lib; |
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 think a mod lib { }
should suffice here, which obviates the need for a secondary file.
☔ The latest upstream changes (presumably #9506) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping! Do you still plan working on this? I think with a rebase and running @rustbot author |
cross-posting #9677 (comment) |
--
Thank you for making Clippy better!
We're collecting our changelog from pull request descriptions.
If your PR only includes internal changes, you can just write
changelog: none
. Otherwise, please write a short commentexplaining your change.
It's also helpful for us that the lint name is put within backticks (
` `
),and then encapsulated by square brackets (
[]
), for example:If your PR fixes an issue, you can add
fixes #issue_number
into thisPR description. This way the issue will be automatically closed when
your PR is merged.
If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.
.stderr
file)cargo test
passes locallycargo dev update_lints
cargo dev fmt
Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.
Delete this line and everything above before opening your PR.
Please write a short comment explaining your change (or "none" for internal only changes)
changelog: