Skip to content

Conversation

@utkrsharmaa
Copy link

@utkrsharmaa utkrsharmaa commented Jun 5, 2025

fixes #259
changelog: New lint [items_before_use]: Checks for misplaced use statements at module level.

Has a configurable strict mode which enforces to group use statements above all other items in module for better code organization and readability.

Both default and strict mode ignore use statements in cfg blocks.

@rustbot
Copy link
Collaborator

rustbot commented Jun 5, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 5, 2025

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@utkrsharmaa
Copy link
Author

Was missing one allow statement for my lint in an internal lint. added it just now. Apologies.

@utkrsharmaa
Copy link
Author

utkrsharmaa commented Jun 14, 2025

r? @y21 PR sat dead for a while, apologies if you weren't available.

@rustbot rustbot assigned y21 and unassigned llogiq Jun 14, 2025
@y21
Copy link
Member

y21 commented Jun 21, 2025

Sorry, I meant to link this here but forgot: I created a thread on Zulip to discuss the idea of the lint: https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/.22Pre.22-FCP.3A.20.60items_before_use.60

@utkrsharmaa
Copy link
Author

@y21 I read the thread. And if I understood correctly the consensus is against the lint. Because the functionality is already covered by the arbitrary_source_item_ordering restriction lint, which is more general and configurable.

This lint is too specialized for what amounts to a stylistic preference. Even if use ordering were widely agreed upon, warning by default is too aggressive.

I understand and I'm fine with this, It was just my first PR and i really wanted to work on a rust project, that's why i assigned another person to get things moving. Apologies for that.

@rustbot
Copy link
Collaborator

rustbot commented Sep 8, 2025

☔ The latest upstream changes (possibly 368b235) made this pull request unmergeable. Please resolve the merge conflicts.

@utkrsharmaa
Copy link
Author

Discussion on this lint unanimously decided it's not going to be needed, and it's been laying dead for a while. Closing.

@utkrsharmaa utkrsharmaa closed this Sep 8, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use statements anywhere but top of module

4 participants