Skip to content

Commit e5cd491

Browse files
authored
Merge pull request rails#53523 from fatkodima/enable-KeywordArgumentsMerging-cop
Enable `Style/KeywordArgumentsMerging` rubocop cop
2 parents efbc4f7 + 4372ba6 commit e5cd491

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ Style/OpenStructUse:
328328
Style/ArrayIntersect:
329329
Enabled: true
330330

331+
Style/KeywordArgumentsMerging:
332+
Enabled: true
333+
331334
Performance/BindCall:
332335
Enabled: true
333336

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ GEM
321321
jmespath (1.6.2)
322322
jsbundling-rails (1.3.1)
323323
railties (>= 6.0.0)
324-
json (2.7.2)
324+
json (2.7.5)
325325
jwt (2.9.3)
326326
base64
327327
kamal (2.2.2)
@@ -418,7 +418,7 @@ GEM
418418
os (1.1.4)
419419
ostruct (0.6.0)
420420
parallel (1.26.3)
421-
parser (3.3.5.0)
421+
parser (3.3.5.1)
422422
ast (~> 2.4.1)
423423
racc
424424
path_expander (1.1.3)
@@ -494,7 +494,7 @@ GEM
494494
retriable (3.1.2)
495495
rexml (3.3.8)
496496
rouge (4.4.0)
497-
rubocop (1.67.0)
497+
rubocop (1.68.0)
498498
json (~> 2.3)
499499
language_server-protocol (>= 3.17.0)
500500
parallel (~> 1.10)
@@ -504,7 +504,7 @@ GEM
504504
rubocop-ast (>= 1.32.2, < 2.0)
505505
ruby-progressbar (~> 1.7)
506506
unicode-display_width (>= 2.4.0, < 3.0)
507-
rubocop-ast (1.32.3)
507+
rubocop-ast (1.33.1)
508508
parser (>= 3.3.1.0)
509509
rubocop-md (1.2.4)
510510
rubocop (>= 1.45)

actionmailer/lib/action_mailer/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def set_content_type(m, user_content_type, class_default) # :doc:
935935
# If the subject has interpolations, you can pass them through the +interpolations+ parameter.
936936
def default_i18n_subject(interpolations = {}) # :doc:
937937
mailer_scope = self.class.mailer_name.tr("/", ".")
938-
I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))
938+
I18n.t(:subject, **interpolations, scope: [mailer_scope, action_name], default: action_name.humanize)
939939
end
940940

941941
# Emails do not support relative path links.

activemodel/lib/active_model/error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def self.generate_message(attribute, type, base, options) # :nodoc:
8383
defaults << :"#{i18n_scope}.errors.messages.#{type}"
8484

8585
catch(:exception) do
86-
translation = I18n.translate(defaults.first, **options.merge(default: defaults.drop(1), throw: true))
86+
translation = I18n.translate(defaults.first, **options, default: defaults.drop(1), throw: true)
8787
return translation unless translation.nil?
8888
end unless options[:message]
8989
else

activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ module ColumnMethods
302302
# Appends a primary key definition to the table definition.
303303
# Can be called multiple times, but this is probably not a good idea.
304304
def primary_key(name, type = :primary_key, **options)
305-
column(name, type, **options.merge(primary_key: true))
305+
column(name, type, **options, primary_key: true)
306306
end
307307

308308
##

activerecord/lib/active_record/delegated_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ module DelegatedType
229229
# Entry#message_uuid # => returns entryable_uuid, when entryable_type == "Message", otherwise nil
230230
# Entry#comment_uuid # => returns entryable_uuid, when entryable_type == "Comment", otherwise nil
231231
def delegated_type(role, types:, **options)
232-
belongs_to role, options.delete(:scope), **options.merge(polymorphic: true)
232+
belongs_to role, options.delete(:scope), **options, polymorphic: true
233233
define_delegated_type_methods role, types: types, options: options
234234
end
235235

activerecord/lib/active_record/encryption/scheme.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def key_provider
5959
end
6060

6161
def merge(other_scheme)
62-
self.class.new(**to_h.merge(other_scheme.to_h))
62+
self.class.new(**to_h, **other_scheme.to_h)
6363
end
6464

6565
def to_h

activerecord/lib/active_record/validations/associated.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def validate_each(record, attribute, value)
77
context = record_validation_context_for_association(record)
88

99
if Array(value).reject { |association| valid_object?(association, context) }.any?
10-
record.errors.add(attribute, :invalid, **options.merge(value: value))
10+
record.errors.add(attribute, :invalid, **options, value: value)
1111
end
1212
end
1313

activesupport/lib/active_support/cache.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def write_multi(hash, options = nil)
556556

557557
instrument_multi :write_multi, normalized_hash, options do |payload|
558558
entries = hash.each_with_object({}) do |(name, value), memo|
559-
memo[normalize_key(name, options)] = Entry.new(value, **options.merge(version: normalize_version(name, options)))
559+
memo[normalize_key(name, options)] = Entry.new(value, **options, version: normalize_version(name, options))
560560
end
561561

562562
write_multi_entries entries, **options
@@ -664,7 +664,7 @@ def write(name, value, options = nil)
664664
key = normalize_key(name, options)
665665

666666
instrument(:write, key, options) do
667-
entry = Entry.new(value, **options.merge(version: normalize_version(name, options)))
667+
entry = Entry.new(value, **options, version: normalize_version(name, options))
668668
write_entry(key, entry, **options)
669669
end
670670
end

0 commit comments

Comments
 (0)