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
Style/RedundantDoubleSplatHashBraces
incorrect Autofix
#12293
Labels
Comments
8 tasks
koic
added a commit
to koic/rubocop
that referenced
this issue
Oct 18, 2023
…latHashBraces` Fixes rubocop#12293. This PR fixes a false positive for `Style/RedundantDoubleSplatHashBraces` when using double splat hash braces with `merge` and method chain.
koic
added a commit
that referenced
this issue
Oct 19, 2023
…dundant_double_splat_hash_braces [Fix #12293] Fix a false positive for `Style/RedundantDoubleSplatHashBraces`
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this issue
Nov 1, 2023
https://build.opensuse.org/request/show/1121572 by user dancermak + dimstar_suse - updated to version 1.57.2 ## 1.57.2 (2023-10-26) ### Bug fixes * [#12274](rubocop/rubocop#12274): Fix a false positive for `Lint/Void` when `each`'s receiver is an object of `Enumerator` to which `filter` has been applied. ([@koic][]) * [#12291](rubocop/rubocop#12291): Fix a false positive for `Metrics/ClassLength` when a class with a singleton class definition. ([@koic][]) * [#12293](rubocop/rubocop#12293): Fix a false positive for `Style/RedundantDoubleSplatHashBraces` when using double splat hash braces with `merge` and method chain. ([@koic][]) * [#12298](rubocop/rubocop#12298): Fix a false positive for `Style/RedundantParentheses` when using a parenthesized hash literal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When upgrading to rubocop 1.57.1, splat arguments can be flagged by the
Style/RedundantDoubleSplatHashBraces
. Runningrubocop -A
for autofixing the problem introduced incorrect code.Expected behavior
Autofix should not try to simplifiy code that has list operations on a part of the argument list, in the example below
.compact_blank
should be applied to the resultingmerge
hash.Actual behavior
Given the following code:
Then running:
Results in:
And the new code:
Steps to reproduce the problem
You can run code similar to the above to reproduce the problem.
You can see the Autofix output from Rubocop is not functionally equivalent to the original by running the following code snippet in Rails console/ IRB:
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: