Add and apply Style/ArgumentsForwarding rule
We were using generic names like `args` and `options` which don't really add anything to `*` or `**` because Ruby required us to. That's no longer the case in Ruby 3.2, so we can simplify the code a bit.
This commit is contained in:
@@ -647,6 +647,9 @@ Style/AccessorGrouping:
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
Style/ArgumentsForwarding:
|
||||
Enabled: true
|
||||
|
||||
Style/ArrayCoercion:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -7,13 +7,8 @@ class Admin::Budgets::ActionsComponent < ApplicationComponent
|
||||
|
||||
private
|
||||
|
||||
def action(action_name, **options)
|
||||
render Admin::ActionComponent.new(
|
||||
action_name,
|
||||
budget,
|
||||
"aria-describedby": true,
|
||||
**options
|
||||
)
|
||||
def action(action_name, **)
|
||||
render Admin::ActionComponent.new(action_name, budget, "aria-describedby": true, **)
|
||||
end
|
||||
|
||||
def actions
|
||||
|
||||
@@ -8,8 +8,8 @@ class Admin::Budgets::LinksComponent < ApplicationComponent
|
||||
|
||||
private
|
||||
|
||||
def action(action_name, **options)
|
||||
render Admin::ActionComponent.new(action_name, budget, **options)
|
||||
def action(action_name, **)
|
||||
render Admin::ActionComponent.new(action_name, budget, **)
|
||||
end
|
||||
|
||||
def results_text
|
||||
|
||||
@@ -6,8 +6,8 @@ class Admin::TableActionsComponent < ApplicationComponent
|
||||
@options = options
|
||||
end
|
||||
|
||||
def action(action_name, **args)
|
||||
render Admin::ActionComponent.new(action_name, record, "aria-label": true, **args)
|
||||
def action(action_name, **)
|
||||
render Admin::ActionComponent.new(action_name, record, "aria-label": true, **)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -2,8 +2,8 @@ module FeatureFlags
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
class_methods do
|
||||
def feature_flag(name, *options)
|
||||
before_action(*options) do
|
||||
def feature_flag(name, *)
|
||||
before_action(*) do
|
||||
check_feature_flag(name)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,8 +7,8 @@ module HasFilters
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def has_filters(valid_filters, *args)
|
||||
before_action(*args) do
|
||||
def has_filters(valid_filters, *)
|
||||
before_action(*) do
|
||||
@valid_filters = valid_filters.respond_to?(:call) ? valid_filters.call(self) : valid_filters
|
||||
@current_filter = @valid_filters.include?(params[:filter]) ? params[:filter] : @valid_filters.first
|
||||
end
|
||||
|
||||
@@ -7,8 +7,8 @@ module HasOrders
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def has_orders(valid_orders, *args)
|
||||
before_action(*args) do |c|
|
||||
def has_orders(valid_orders, *)
|
||||
before_action(*) do |c|
|
||||
@valid_orders = valid_orders.respond_to?(:call) ? valid_orders.call(c) : valid_orders.dup
|
||||
@valid_orders.delete("relevance") if params[:search].blank?
|
||||
@current_order = @valid_orders.include?(params[:order]) ? params[:order] : @valid_orders.first
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module RemotelyTranslatable
|
||||
private
|
||||
|
||||
def detect_remote_translations(*args)
|
||||
def detect_remote_translations(*)
|
||||
return [] unless Setting["feature.remote_translations"].present? && api_key_has_been_set_in_secrets?
|
||||
|
||||
RemoteTranslation.for(*args)
|
||||
RemoteTranslation.for(*)
|
||||
end
|
||||
|
||||
def api_key_has_been_set_in_secrets?
|
||||
|
||||
@@ -10,8 +10,8 @@ module ApplicationHelper
|
||||
%i[ar fa he].include?(locale)
|
||||
end
|
||||
|
||||
def markdown(text, **render_options)
|
||||
MarkdownConverter.new(text, **render_options).render
|
||||
def markdown(text, **)
|
||||
MarkdownConverter.new(text, **).render
|
||||
end
|
||||
|
||||
def wysiwyg(text)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module LinkListHelper
|
||||
def link_list(*links, **options)
|
||||
render Shared::LinkListComponent.new(*links, **options)
|
||||
def link_list(*, **)
|
||||
render Shared::LinkListComponent.new(*, **)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,8 +12,8 @@ class RemoteTranslation < ApplicationRecord
|
||||
RemoteTranslations::Caller.new(self).delay.call
|
||||
end
|
||||
|
||||
def self.for(*args)
|
||||
resources_groups(*args).flatten.select { |resource| translation_empty?(resource) }.map do |resource|
|
||||
def self.for(*)
|
||||
resources_groups(*).flatten.select { |resource| translation_empty?(resource) }.map do |resource|
|
||||
new(remote_translatable: resource, locale: I18n.locale)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -409,8 +409,8 @@ class User < ApplicationRecord
|
||||
followables.compact.map { |followable| followable.tags.map(&:name) }.flatten.compact.uniq
|
||||
end
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
def send_devise_notification(notification, *)
|
||||
devise_mailer.send(notification, self, *).deliver_later
|
||||
end
|
||||
|
||||
def add_subscriptions_token
|
||||
|
||||
Reference in New Issue
Block a user