Skip to content

Commit

Permalink
Enable Style/RedundantDoubleSplatHashBraces rubocop cop
Browse files Browse the repository at this point in the history
  • Loading branch information
fatkodima committed Oct 11, 2023
1 parent 174ab6c commit b8829ca
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -296,6 +296,9 @@ Style/TrivialAccessors:
Style/RedundantCondition:
Enabled: true

Style/RedundantDoubleSplatHashBraces:
Enabled: true

Performance/BindCall:
Enabled: true

Expand Down
22 changes: 13 additions & 9 deletions Gemfile.lock
Expand Up @@ -298,6 +298,7 @@ GEM
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
libxml-ruby (4.0.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand Down Expand Up @@ -363,9 +364,10 @@ GEM
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
os (1.1.4)
parallel (1.22.1)
parser (3.2.1.1)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
path_expander (1.1.1)
pg (1.5.3)
prettier_print (1.2.1)
Expand Down Expand Up @@ -415,7 +417,7 @@ GEM
connection_pool
redis-namespace (1.10.0)
redis (>= 4)
regexp_parser (2.6.2)
regexp_parser (2.8.2)
reline (0.3.2)
io-console (~> 0.5)
representable (3.2.0)
Expand All @@ -433,19 +435,21 @@ GEM
resque (>= 1.27)
rufus-scheduler (~> 3.2, != 3.3)
retriable (3.1.2)
rexml (3.2.5)
rexml (3.2.6)
rouge (4.1.3)
rubocop (1.48.1)
rubocop (1.57.0)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.26.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-md (1.2.0)
rubocop (>= 1.0)
Expand Down Expand Up @@ -535,7 +539,7 @@ GEM
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
w3c_validators (1.3.7)
json (>= 1.8)
nokogiri (~> 1.6)
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/dispatch/ssl_test.rb
Expand Up @@ -10,7 +10,7 @@ def build_app(headers: {}, ssl_options: {})
Rack::Lint.new(
ActionDispatch::SSL.new(
Rack::Lint.new(app),
**ssl_options.reverse_merge(hsts: { subdomains: true }),
hsts: { subdomains: true }, **ssl_options,
)
)
end
Expand Down
6 changes: 3 additions & 3 deletions actionview/lib/action_view/helpers/asset_tag_helper.rb
Expand Up @@ -351,13 +351,13 @@ def preload_link_tag(source, options = {})
nopush = options.delete(:nopush) || false
rel = mime_type == "module" ? "modulepreload" : "preload"

link_tag = tag.link(**{
link_tag = tag.link(
rel: rel,
href: href,
as: as_type,
type: mime_type,
crossorigin: crossorigin
}.merge!(options.symbolize_keys))
crossorigin: crossorigin,
**options.symbolize_keys)

preload_link = "<#{href}>; rel=#{rel}; as=#{as_type}"
preload_link += "; type=#{mime_type}" if mime_type
Expand Down
2 changes: 1 addition & 1 deletion actionview/test/template/template_test.rb
Expand Up @@ -59,7 +59,7 @@ def my_buffer

def new_template(body = "<%= hello %>", details = {})
details = { format: :html, locals: [] }.merge details
ActionView::Template.new(body.dup, "hello template", details.delete(:handler) || ERBHandler, **{ virtual_path: "hello" }.merge!(details))
ActionView::Template.new(body.dup, "hello template", details.delete(:handler) || ERBHandler, virtual_path: "hello", **details)
end

def render(locals = {})
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/migration/compatibility_test.rb
Expand Up @@ -330,8 +330,8 @@ def migrate(x)

ActiveRecord::Migrator.new(:up, [migration], @schema_migration, @internal_metadata).migrate

assert connection.column_exists?(:more_testings, :created_at, **{ precision: 6 })
assert connection.column_exists?(:more_testings, :updated_at, **{ precision: 6 })
assert connection.column_exists?(:more_testings, :created_at, precision: 6)
assert connection.column_exists?(:more_testings, :updated_at, precision: 6)
ensure
connection.drop_table :more_testings rescue nil
end
Expand Down
Expand Up @@ -164,11 +164,11 @@ def i18n_format_options
end

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

def translate_in_locale(key, **i18n_options)
translate_number_value_with_default(key, **{ locale: options[:locale] }.merge(i18n_options))
translate_number_value_with_default(key, locale: options[:locale], **i18n_options)
end

def default_value(key)
Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_storage_overview.md
Expand Up @@ -1326,7 +1326,7 @@ class DirectUploadsController < ActiveStorage::DirectUploadsController
def authenticate!
@token = request.headers['Authorization']&.split&.last

return head :unauthorized unless valid_token?(@token)
head :unauthorized unless valid_token?(@token)
end
end
```
Expand Down
5 changes: 3 additions & 2 deletions guides/source/active_support_core_extensions.md
Expand Up @@ -123,8 +123,9 @@ The method [`present?`][Object#present?] is equivalent to `!blank?`. This exampl

```ruby
def set_conditional_cache_control!
return if self["Cache-Control"].present?
# ...
unless self["Cache-Control"].present?
# ...
end
end
```

Expand Down

0 comments on commit b8829ca

Please sign in to comment.