Add and apply Style/KeywordArgumentsMerging rubocop rule

This rule was introduced in RuboCop 1.68 to encourage passing
additional keyword arguments directly instead of using merge.
This commit is contained in:
taitus
2025-02-13 10:48:16 +01:00
parent ada35f51f2
commit 9081174dd7
4 changed files with 7 additions and 4 deletions

View File

@@ -743,6 +743,9 @@ Style/InvertibleUnlessCondition:
:present?: :blank?
:zero?: ~
Style/KeywordArgumentsMerging:
Enabled: true
Style/LineEndConcatenation:
Enabled: true

View File

@@ -15,6 +15,6 @@ class Admin::AllowedTableActionsComponent < ApplicationComponent
end
def table_actions_component
@table_actions_component ||= Admin::TableActionsComponent.new(record, **options.merge(actions: actions))
@table_actions_component ||= Admin::TableActionsComponent.new(record, **options, actions: actions)
end
end

View File

@@ -2,10 +2,10 @@
<%= content %>
<% if actions.include?(:edit) %>
<%= action(:edit, **edit_options.merge(text: edit_text, path: edit_path)) %>
<%= action(:edit, **edit_options, text: edit_text, path: edit_path) %>
<% end %>
<% if actions.include?(:destroy) %>
<%= action(:destroy, **destroy_options.merge(text: destroy_text, path: destroy_path)) %>
<%= action(:destroy, **destroy_options, text: destroy_text, path: destroy_path) %>
<% end %>
</div>

View File

@@ -1,6 +1,6 @@
RSpec::Matchers.define :have_avatar do |text, **options|
match do |page|
page.has_css?("svg.initialjs-avatar", **{ exact_text: text }.merge(options))
page.has_css?("svg.initialjs-avatar", **{ exact_text: text }, **options)
end
failure_message do