Skip to content

Add import_rename lint, this adds a field on the Conf struct - #7300

Merged
bors merged 1 commit into
rust-lang:masterfrom
DevinR528:import-rename
Jun 24, 2021
Merged

bors merged 1 commit into
rust-lang:masterfrom
DevinR528:import-rename

Conversation

@DevinR528

Copy link
Copy Markdown
Contributor

fixes #7276

changelog: Add [`import_rename`] a lint that enforces import renaming defined in the config file.

@rust-highfive

Copy link
Copy Markdown

r? @flip1995

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 31, 2021
Comment thread clippy_lints/src/import_rename.rs Resolved
@bors

bors commented Jun 10, 2021

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #7315) made this pull request unmergeable. Please resolve the merge conflicts.

Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/lib.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
bors added a commit that referenced this pull request Jun 14, 2021
Remove requirement of fully qualified path for disallowed_method/type

changelog: Remove the need for fully qualified paths in disallowed_method and disallowed_type

After fixing this issue in [import_rename](#7300 (comment)) I figured I'd fix it for these two.

If this does in fact fix the **Known problems:** section I was planning to remove them from both lints after confirmation.
@bors

bors commented Jun 19, 2021

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #7299) made this pull request unmergeable. Please resolve the merge conflicts.

@DevinR528
DevinR528 force-pushed the import-rename branch 2 times, most recently from 2ceaffa to 8b44012 Compare June 20, 2021 10:32
@bors

bors commented Jun 21, 2021

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #7385) made this pull request unmergeable. Please resolve the merge conflicts.

@flip1995

Copy link
Copy Markdown
Member

@DevinR528 This will need a rebase.

r? @camsteffen You pretty much reviewed this PR yourself. Can you please take over the review of this PR?

@rust-highfive rust-highfive assigned camsteffen and unassigned flip1995 Jun 21, 2021
@flip1995 flip1995 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 Jun 21, 2021
@DevinR528

Copy link
Copy Markdown
Contributor Author

Rebased and ready to go.

Is there a web page like the one with all the clippy lints with the config options? I feel like I've seen/used it or I'm imagining 🤷

@flip1995

Copy link
Copy Markdown
Member

The config options are on the webpage with the lint documentation. To try it out, you can run cargo dev serve in your checkout. This will open a browser window with the website including your local changes. You can then search for the lint to check if it has the documentation for the config.

@camsteffen camsteffen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm unsure about the lint name. deny(import_rename) looks like a total ban of renames. missing_enforced_import_renames is a bit long...

I think the config option could be named enforced_import_renames to be more clear.

CC @rust-lang/clippy thoughts?

Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/utils/conf.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
Comment thread clippy_lints/src/import_rename.rs Resolved
@Manishearth

Copy link
Copy Markdown
Member

I like the rename proposed by @camsteffen

@camsteffen camsteffen left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One nit. Please squash commits then r=me. Thanks!

@camsteffen

Copy link
Copy Markdown
Contributor

@bors delegate+

@bors

bors commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

✌️ @DevinR528 can now approve this pull request

@camsteffen

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

📌 Commit 9492de5 has been approved by camsteffen

@bors

bors commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9492de5 with merge b286b38...

@bors

bors commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: camsteffen
Pushing b286b38 to master...

@bors
bors merged commit b286b38 into rust-lang:master Jun 24, 2021
@DevinR528
DevinR528 deleted the import-rename branch June 25, 2021 10:27
@DevinR528

Copy link
Copy Markdown
Contributor Author

Thanks everyone who helped especially @camsteffen!

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.

New lint: enforce import renaming

8 participants