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

[Fix #6648] EmptyLiteral - wrap arguments in parentheses when correcting Hash.new is the fist argument to super #6680

Merged
merged 1 commit into from Jan 22, 2019

Conversation

rrosenblum
Copy link
Contributor

This fixes #6648.

…correcting Hash.new is the fist argument to super
@rrosenblum rrosenblum changed the title [Fix #6648] EmptyLiteral - wrap arguments in parenthese when correcting Hash.new is the fist argument to super [Fix #6648] EmptyLiteral - wrap arguments in parentheses when correcting Hash.new is the fist argument to super Jan 16, 2019

_receiver, _method_name, *args = *node.parent
node.object_id == args.first.object_id && !parentheses?(node.parent)
node.object_id == parent.arguments.first.object_id &&
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 we have been using #equal? for identity checks. (Perhaps a cop opportunity. 🙂)

@Drenmi Drenmi merged commit 35251b4 into rubocop:master Jan 22, 2019
@rrosenblum rrosenblum deleted the 6648_empty_literal_hash_super branch January 22, 2019 16:34
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.

Style/EmptyLiteral is (possibly) not safe
2 participants