rust-lang / rust-lang/rust-clippy
module/crate level enforced-import-renames
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
enforced-import-renames can suggest renaming a single item. But when we want to rename a item, is is probable that we want to also rename other items similarly.
One particular example is that when we define 2 set of data types, one in rust and one in protobuf (and use prost to generates Rust code). We may want to rename all items generated by prost to ProstXxx.
Lint Name
No response
Category
restriction
Advantage
No response
Drawbacks
No response
Example
use serde_json::{Value, Error};
Could be written as:
use serde_json::{Value as JsonValue, Error as JsonError, ...};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing enforced-import-renames lint and its linked documentation entry to understand its current single-item behavior. Define how the proposed module- or crate-level scope should select related imports, using the serde_json and ProstXxx examples as acceptance cases. Done means the broader rename behavior is specified and implemented with corresponding lint documentation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100