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

Add new Style/RedundantSelfAssignment cop #8516

Merged
merged 2 commits into from Aug 17, 2020

Conversation

fatkodima
Copy link
Contributor

Closes #8451

@fatkodima fatkodima force-pushed the redundant_self_assignment-cop branch from 49e2f0a to a89f55b Compare August 10, 2020 22:03
@marcandre
Copy link
Contributor

Thanks for this cop ♥️


# good
args.concat(foo)
args += foo
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you forgot the bad example for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the previous line are both good examples for args = args.concat(ary) (couple of lines above)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, my bad!

@bbatsov bbatsov merged commit 2845f8d into rubocop:master Aug 17, 2020
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.

Cop idea: redudant self assignment
3 participants