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.
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.
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.
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.
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.
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_numberinto 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.
.stderrfile)cargo testpasses locallycargo dev update_lintscargo dev fmtNote 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: