Enable Style/RedundantDoubleSplatHashBraces
rubocop cop
This commit is contained in:
parent
174ab6c342
commit
b8829cabec
@ -296,6 +296,9 @@ Style/TrivialAccessors:
|
||||
Style/RedundantCondition:
|
||||
Enabled: true
|
||||
|
||||
Style/RedundantDoubleSplatHashBraces:
|
||||
Enabled: true
|
||||
|
||||
Performance/BindCall:
|
||||
Enabled: true
|
||||
|
||||
|
22
Gemfile.lock
22
Gemfile.lock
@ -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)
|
||||
@ -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)
|
||||
@ -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)
|
||||
@ -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)
|
||||
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 = {})
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user