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

feat: add rule for redundant import alias #854

Merged
merged 3 commits into from
Jul 31, 2023
Merged

Conversation

damif94
Copy link
Contributor

@damif94 damif94 commented Jul 29, 2023

PR for issue #853

A new rule redundant-import-alias that would warn upon redundant import aliases, i.e., when the imported package name matches the alias names.

Copy link
Collaborator

@chavacava chavacava left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the rule idea and its PR!
I've left some comments, please let me know what do you think about them.

README.md Outdated Show resolved Hide resolved
rule/unused-import-alias.go Outdated Show resolved Hide resolved
rule/unused-import-alias.go Outdated Show resolved Hide resolved
@damif94
Copy link
Contributor Author

damif94 commented Jul 30, 2023

Hi, thanks for the rule idea and its PR! I've left some comments, please let me know what do you think about them.

I agree with your suggestions, "redundant" seems like more appropriate. I already did the changes.

What's your view on making this rule as default? It seems like a pretty unquestionable linting rule, but on the other hand I got fear of retrocompatibility on upgrading versions and not sure on what's the project policies on upgrades.

@damif94 damif94 requested a review from chavacava July 30, 2023 18:57
@damif94 damif94 changed the title feat: add rule for unused import alias feat: add rule for redundant import alias Jul 30, 2023
@chavacava
Copy link
Collaborator

Hi, thanks for the rule idea and its PR! I've left some comments, please let me know what do you think about them.

I agree with your suggestions, "redundant" seems like more appropriate. I already did the changes.

What's your view on making this rule as default? It seems like a pretty unquestionable linting rule, but on the other hand I got fear of retrocompatibility on upgrading versions and not sure on what's the project policies on upgrades.

Thanks for the modifications.
About making this rule default: historically, revive default rules were those of golint. I propose to let the new rule out of the defaults and actvite it through the config.

@chavacava chavacava merged commit 7bd6668 into mgechev:master Jul 31, 2023
12 checks passed
@chavacava
Copy link
Collaborator

Thanks @damif94 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants