Skip to content

arbitrary_source_item_ordering should ignore test modules #14585

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

Conversation

alex-semenyuk
Copy link
Member

@alex-semenyuk alex-semenyuk commented Apr 10, 2025

Close #14570

The test is provided here but it's passed without //@compile-flags: --test

changelog: [arbitrary_source_item_ordering]: should ignore test modules

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2025

r? @blyxyas

rustbot has assigned @blyxyas.
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 Apr 10, 2025
@alex-semenyuk alex-semenyuk force-pushed the arbitrary_source_item_ordering_ingnore_test_modules branch from d09f334 to d145f69 Compare April 10, 2025 22:21
@samueltardieu
Copy link
Contributor

I'll handle both #14585 and #14580.
r? @samueltardieu

@rustbot rustbot assigned samueltardieu and unassigned blyxyas Apr 11, 2025
Copy link
Contributor

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. However, in the future it may be great not to rush into issues marked with the "good first issue" label, those are identified in order to make it easier for beginners who want to make their first contribution to Clippy to start.

The PR looks good, but there is no test showing that it doesn't impact the rest of the lint. Could you please add the very same change you did in ordering_good.rs to selective_ordering.rs? This would check that the content of the module under #[cfg(test)] is still linted (as it will show that B should be declared after A). That would require an error marker for the ord_within test variant.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Apr 11, 2025
@alex-semenyuk alex-semenyuk force-pushed the arbitrary_source_item_ordering_ingnore_test_modules branch from d145f69 to e1bd4e4 Compare April 11, 2025 08:43
@samueltardieu samueltardieu enabled auto-merge April 11, 2025 08:47
@samueltardieu samueltardieu added this pull request to the merge queue Apr 11, 2025
Merged via the queue into rust-lang:master with commit c67df05 Apr 11, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arbitrary_source_item_ordering ignores test modules
4 participants