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 #8475] Fix a false positive for Style/HashAsLastArrayItem when t… #8477

Merged
merged 1 commit into from Aug 8, 2020
Merged

[Fix #8475] Fix a false positive for Style/HashAsLastArrayItem when t… #8477

merged 1 commit into from Aug 8, 2020

Conversation

wcmonty
Copy link

@wcmonty wcmonty commented Aug 6, 2020

Closes #8475

The issue is that we were previously comparing values to the last node. If a node equals the last node it will be marked with an offense, when it should not be.

@koic
Copy link
Member

koic commented Aug 7, 2020

This looks good to me. Can you add changelog entry and squash your commits into one?
The following is the changelog entry format.
https://github.com/rubocop-hq/rubocop/blob/master/CONTRIBUTING.md#changelog-entry-format

…here are duplicate hashes in the array Co-authored-by: Koichi ITO <koic.ito@gmail.com>
@wcmonty
Copy link
Author

wcmonty commented Aug 7, 2020

@koic This is rebased/squashed with the changelog entry added. One set of specs is failing (https://github.com/rubocop-hq/rubocop/pull/8477/checks?check_run_id=959581086), but it doesn't look related to this PR.

@koic koic merged commit 1a4e748 into rubocop:master Aug 8, 2020
@koic
Copy link
Member

koic commented Aug 8, 2020

It was a false alarm of CI. I re-ran it again and passed it. Thank you!

@wcmonty wcmonty deleted the wm/8475 branch August 10, 2020 14:18
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/HashAsLastArrayItem copy with style "no_braces" can result in invalid code
2 participants