From 3e1be86283ccf52bcf6b3a08fe98374822752041 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:36:50 +0000 Subject: [PATCH 1/3] chore(deps-dev): bump rubocop from 1.63.5 to 1.64.1 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.63.5 to 1.64.1. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.63.5...v1.64.1) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cd805c54f0..f02a541e31 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -494,7 +494,7 @@ GEM parallel (1.24.0) paranoia (2.6.3) activerecord (>= 5.1, < 7.2) - parser (3.3.1.0) + parser (3.3.2.0) ast (~> 2.4.1) racc paypal-sdk-core (0.3.4) @@ -604,7 +604,7 @@ GEM redis-client (>= 0.22.0) redis-client (0.22.1) connection_pool - regexp_parser (2.9.0) + regexp_parser (2.9.2) reline (0.5.0) io-console (~> 0.5) request_store (1.5.1) @@ -667,7 +667,7 @@ GEM rswag-ui (2.13.0) actionpack (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) - rubocop (1.63.5) + rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) From e6ac2f0d886f2d62e7bfbc5d7f1a6b54b59b8a3c Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Jun 2024 09:29:42 +1000 Subject: [PATCH 2/3] Style/SuperArguments Call super without arguments and parentheses when the signature is identical. --- app/components/help_modal_component.rb | 2 +- app/controllers/application_controller.rb | 2 +- app/helpers/bulk_form_builder.rb | 2 +- app/models/concerns/file_preferences.rb | 2 +- .../enterprise_fees_with_tax_report_by_order.rb | 2 +- .../enterprise_fees_with_tax_report_by_producer.rb | 2 +- lib/reporting/reports/enterprise_fee_summary/fee_summary.rb | 2 +- lib/reporting/reports/enterprise_fee_summary/parameters.rb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/components/help_modal_component.rb b/app/components/help_modal_component.rb index 297ff34765..fef42131aa 100644 --- a/app/components/help_modal_component.rb +++ b/app/components/help_modal_component.rb @@ -2,6 +2,6 @@ class HelpModalComponent < ModalComponent def initialize(id:, close_button: true) - super(id:, close_button:) + super end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8c5675b217..c31e748a30 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -60,7 +60,7 @@ class ApplicationController < ActionController::Base rescue StandardError 'unknown' end}") - super(options, response_status) + super end def set_checkout_redirect diff --git a/app/helpers/bulk_form_builder.rb b/app/helpers/bulk_form_builder.rb index dcb45ae3bc..cd1da4e54e 100644 --- a/app/helpers/bulk_form_builder.rb +++ b/app/helpers/bulk_form_builder.rb @@ -8,6 +8,6 @@ class BulkFormBuilder < ActionView::Helpers::FormBuilder opts[:class] = "#{opts[:class]} changed".strip end - super(field, **opts) + super end end diff --git a/app/models/concerns/file_preferences.rb b/app/models/concerns/file_preferences.rb index 68682b3263..00dedce496 100644 --- a/app/models/concerns/file_preferences.rb +++ b/app/models/concerns/file_preferences.rb @@ -22,7 +22,7 @@ module FilePreferences if has_preference?("#{key}_blob_id") :file else - super(key) + super end end diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb index 2ea4a4db14..6b09906076 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb @@ -7,7 +7,7 @@ module Reporting attr_accessor :parameters def initialize(user, params = {}, render: false) - super(user, params, render:) + super end def search diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb index 2760112f1b..a9e487c2e7 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb @@ -7,7 +7,7 @@ module Reporting attr_accessor :permissions def initialize(user, params = {}, render: false) - super(user, params, render:) + super @permissions = Permissions.new(user) end diff --git a/lib/reporting/reports/enterprise_fee_summary/fee_summary.rb b/lib/reporting/reports/enterprise_fee_summary/fee_summary.rb index c2fc14159b..61679e445e 100644 --- a/lib/reporting/reports/enterprise_fee_summary/fee_summary.rb +++ b/lib/reporting/reports/enterprise_fee_summary/fee_summary.rb @@ -7,7 +7,7 @@ module Reporting attr_accessor :permissions, :parameters def initialize(user, params = {}, render: false) - super(user, params, render:) + super @parameters = Parameters.new(params.fetch(:q, {})) @parameters.validate! @permissions = Permissions.new(user) diff --git a/lib/reporting/reports/enterprise_fee_summary/parameters.rb b/lib/reporting/reports/enterprise_fee_summary/parameters.rb index 26c0b1dc06..f5a6febb17 100644 --- a/lib/reporting/reports/enterprise_fee_summary/parameters.rb +++ b/lib/reporting/reports/enterprise_fee_summary/parameters.rb @@ -28,7 +28,7 @@ module Reporting self.shipping_method_ids = [] self.payment_method_ids = [] - super(attributes) + super cleanup_arrays end From d9f013abbc9ea1c323432303d331385a711c13ad Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 5 Jun 2024 09:33:41 +1000 Subject: [PATCH 3/3] Style/SendWithLiteralMethodName Use method call directly instead of `public_send` with fixed argument. The cop is declared unsafe. I think that is because it can also replace `send` but we replace only `public_send` here. --- app/controllers/admin/resource_controller.rb | 2 +- lib/reporting/queries/query_builder.rb | 2 +- lib/spree/authentication_helpers.rb | 6 +++--- spec/swagger_helper.rb | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/resource_controller.rb b/app/controllers/admin/resource_controller.rb index b47336f0d1..b15a576f40 100644 --- a/app/controllers/admin/resource_controller.rb +++ b/app/controllers/admin/resource_controller.rb @@ -146,7 +146,7 @@ module Admin return nil if parent_data.blank? @parent ||= parent_data[:model_class]. - public_send("find_by", parent_data[:find_by] => params["#{model_name}_id"]) + find_by(parent_data[:find_by] => params["#{model_name}_id"]) instance_variable_set("@#{model_name}", @parent) end diff --git a/lib/reporting/queries/query_builder.rb b/lib/reporting/queries/query_builder.rb index 02e908ab2d..23697a6824 100644 --- a/lib/reporting/queries/query_builder.rb +++ b/lib/reporting/queries/query_builder.rb @@ -15,7 +15,7 @@ module Reporting end def selecting(lambda) - fields = instance_exec(&lambda).map{ |key, value| value.public_send(:as, key.to_s) } + fields = instance_exec(&lambda).map{ |key, value| value.as(key.to_s) } reflect query.project(*fields) end diff --git a/lib/spree/authentication_helpers.rb b/lib/spree/authentication_helpers.rb index f463ebbdb4..d92febf78d 100644 --- a/lib/spree/authentication_helpers.rb +++ b/lib/spree/authentication_helpers.rb @@ -3,9 +3,9 @@ module Spree module AuthenticationHelpers def self.included(receiver) - receiver.public_send :helper_method, :spree_current_user - receiver.public_send :helper_method, :spree_login_path - receiver.public_send :helper_method, :spree_logout_path + receiver.helper_method :spree_current_user + receiver.helper_method :spree_login_path + receiver.helper_method :spree_logout_path end def spree_current_user diff --git a/spec/swagger_helper.rb b/spec/swagger_helper.rb index 0a131fb5ff..b3a3676cbc 100644 --- a/spec/swagger_helper.rb +++ b/spec/swagger_helper.rb @@ -75,7 +75,7 @@ end module RswagExtension def param(args, &) - public_send(:let, args) { instance_eval(&) } + let(args) { instance_eval(&) } end end Rswag::Specs::ExampleGroupHelpers.prepend RswagExtension