rust-lang / rust-lang/rust-clippy

Modules with "test" in name no longer considered test modules

Open
#13,111 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

I-false-negative
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

Description

It seems like an intentional change from #13049. However, it is common in our codebase to have a testing feature that enables test utilities for integration tests or tests in other crates in the workspace. These are no longer excluded from wildcard_imports and some other lints. It would be great to have configuration for this, either checking for the "test" name again or setting a list of features that are included in the cfg check.

Regardless of whether that becomes available, the docs for wildcard_import should be updated: https://github.com/rust-lang/rust-clippy/blob/0ee9f44568b60aaef5d04684cb08f112edd89542/clippy_lints/src/wildcard_imports.rs#L70

Version

No response

Additional Labels

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with clippy_lints/src/wildcard_imports.rs around line 70 and compare the current behavior with the intentional change in issue #13049. Check how test modules and features are handled for wildcard_imports and related lints. Done means either configurable test-feature handling is defined and covered, or the wildcard_import documentation accurately explains the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.