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

lint identity_conversion name is misleading #3106

Closed
imp opened this issue Aug 29, 2018 · 2 comments · Fixed by #5568
Closed

lint identity_conversion name is misleading #3106

imp opened this issue Aug 29, 2018 · 2 comments · Fixed by #5568
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages S-needs-discussion Status: Needs further discussion before merging or work can be started

Comments

@imp
Copy link
Contributor

imp commented Aug 29, 2018

The lint identity_conversion has a somewhat misleading name. It feels like it suggests the identity conversion is being actually done somewhere in the code. In reality, however, this lint checks for useless conversion from some type to the very same type. Indeed, the error that is reported by this lint is error: identical conversion, which points exactly to the issue in hand.
I want to suggest renaming the lint to match the error report.
I.e. identity_conversion -> identical_conversion
Or, perhaps, to useless_identity_conversion (which is admittedly longer name).

What is the policy on lint renaming? Is it something that may be done at all? Supported?
Encouraged/discouraged?

@oli-obk
Copy link
Contributor

oli-obk commented Sep 3, 2018

Maybe just useless_conversion?

@oli-obk oli-obk added C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages S-needs-discussion Status: Needs further discussion before merging or work can be started labels Sep 3, 2018
@ExpHP
Copy link

ExpHP commented Jun 14, 2019

I'd rather propose the opposite and change the text to read identity conversion. I find "identical conversion" to be confusing language.

The lint identity_conversion has a somewhat misleading name. It feels like it suggests the identity conversion is being actually done somewhere in the code. In reality, however, this lint checks for useless conversion from some type to the very same type.

I don't see the difference.

bors added a commit that referenced this issue May 16, 2020
Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`
bors added a commit that referenced this issue May 16, 2020
Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`
bors added a commit that referenced this issue May 17, 2020
Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`
@bors bors closed this as completed in e214ea8 May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants