Skip to content
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

[mod_module_files] Don't emit lint for mod.rs in tests #11779

Merged
merged 1 commit into from Nov 8, 2023
Merged

[mod_module_files] Don't emit lint for mod.rs in tests #11779

merged 1 commit into from Nov 8, 2023

Conversation

m-rph
Copy link
Contributor

@m-rph m-rph commented Nov 8, 2023

fixes: #11775

current state: indiscriminately emits the lint for mod files in tests.

The following

tests/
  common/
    mod.rs
  test.rs

is a common pattern for code shared across the tests and is suggested in the rust book. The change adds an additional check to verify that the mod file is not in tests.

changelog: Fix [mod_module_files]: false positive for mod files in tests folder

fixes: #11775

current state: indiscriminately emits the lint for mod files in tests.

The following

tests/
  common/
    mod.rs
  test.rs

is a common pattern for code shared across the tests and is suggested in
the rust book. The change adds an additional check to verify that the
mod file is not in tests.

changelog: Fix [`mod_module_files`]: false positive for mod files in
tests folder
@rustbot
Copy link
Collaborator

rustbot commented Nov 8, 2023

r? @blyxyas

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 8, 2023
@m-rph m-rph changed the title [mod_module_files] Don't emit lint for modules in tests [mod_module_files] Don't emit lint for mod.rs in tests Nov 8, 2023
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ❤️

@blyxyas
Copy link
Member

blyxyas commented Nov 8, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 8, 2023

📌 Commit 7e716ff has been approved by blyxyas

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 8, 2023

⌛ Testing commit 7e716ff with merge 34b7d15...

@bors
Copy link
Collaborator

bors commented Nov 8, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: blyxyas
Pushing 34b7d15 to master...

@bors bors merged commit 34b7d15 into rust-lang:master Nov 8, 2023
5 checks passed
@m-rph m-rph deleted the 11775 branch November 8, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow mod files within tests directory
4 participants