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

Enable Style/RedundantDoubleSplatHashBraces rubocop cop #49582

Merged

Conversation

fatkodima
Copy link
Member

While working through #49576, I identified some code in the relevant class, which can be improved via rubocop.

def translate_number_value_with_default(key, **i18n_options)
I18n.translate(key, **{ default: default_value(key), scope: :number }.merge!(i18n_options))
end
def translate_in_locale(key, **i18n_options)
translate_number_value_with_default(key, **{ locale: options[:locale] }.merge(i18n_options))
end

Also fixed 2 new offenses for Style/RedundantReturn in the md files along the way.

I also updated rubocop to include the changes I suggested to rubocop after this finding - rubocop/rubocop#12257

@fatkodima fatkodima force-pushed the enable-RedundantDoubleSplatHashBraces-cop branch from becb0bc to b8829ca Compare October 11, 2023 11:55
@kamipo kamipo merged commit 7514031 into rails:main Oct 11, 2023
3 of 4 checks passed
@fatkodima fatkodima deleted the enable-RedundantDoubleSplatHashBraces-cop branch October 11, 2023 16:22
koic added a commit to koic/rubocop-rails_config that referenced this pull request Oct 13, 2023
Follow up rails/rails#49582.

This PR enables `Style/RedundantDoubleSplatHashBraces` cop and
requires RuboCop 1.57+.
koic added a commit to koic/rubocop-rails_config that referenced this pull request Oct 13, 2023
Follow up rails/rails#49582.

This PR enables `Style/RedundantDoubleSplatHashBraces` cop and
requires RuboCop 1.57+.
koic added a commit to koic/rubocop-rails_config that referenced this pull request Oct 15, 2023
Follow up rails/rails#49582.

This PR enables `Style/RedundantDoubleSplatHashBraces` cop and
requires RuboCop 1.57+.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants