From 29f476e559c904bc11a8e03daac0f46312d5a87d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 04:01:42 +0000 Subject: [PATCH 1/2] chore(deps-dev): bump rubocop-rails from 2.20.2 to 2.21.0 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.20.2 to 2.21.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.20.2...v2.21.0) --- updated-dependencies: - dependency-name: rubocop-rails dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5d468cfb8d..9a01708782 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -408,7 +408,7 @@ GEM mini_magick (4.11.0) mini_mime (1.1.5) mini_portile2 (2.8.4) - minitest (5.19.0) + minitest (5.20.0) monetize (1.12.0) money (~> 6.12) money (6.16.0) @@ -634,7 +634,7 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.29.0) parser (>= 3.2.1.0) - rubocop-rails (2.20.2) + rubocop-rails (2.21.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) From 99529ff599df055c8038641a6294fc2354f9efa9 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 11 Sep 2023 15:44:15 +1000 Subject: [PATCH 2/2] Put new rubocop violations on todo list --- .rubocop_todo.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 33f527d1e3..7ad759f944 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -412,6 +412,21 @@ Naming/VariableNumber: - 'spec/models/spree/tax_rate_spec.rb' - 'spec/requests/api/orders_spec.rb' +# Offense count: 11 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods, AllowedPatterns. +# AllowedMethods: order, limit, select, lock +Rails/FindEach: + Exclude: + - 'app/controllers/admin/order_cycles_controller.rb' + - 'app/jobs/subscription_confirm_job.rb' + - 'app/services/orders_bulk_cancel_service.rb' + - 'app/services/products_renderer.rb' + - 'lib/tasks/data.rake' + - 'lib/tasks/subscriptions/debug.rake' + - 'spec/system/admin/bulk_order_management_spec.rb' + - 'spec/system/admin/enterprise_relationships_spec.rb' + # Offense count: 47 # Configuration parameters: Include. # Include: app/models/**/*.rb @@ -438,14 +453,13 @@ Rails/HasManyOrHasOneDependent: - 'app/models/spree/user.rb' - 'app/models/spree/variant.rb' -# Offense count: 26 +# Offense count: 25 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: Exclude: - 'app/helpers/injection_helper.rb' - 'app/helpers/shared_helper.rb' - - 'app/helpers/shop_helper.rb' - 'app/helpers/spree/admin/orders_helper.rb' - 'app/helpers/spree/orders_helper.rb' @@ -561,6 +575,22 @@ Rails/PluckInWhere: Exclude: - 'app/models/spree/variant.rb' +# Offense count: 15 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/RedundantActiveRecordAllMethod: + Exclude: + - 'app/models/spree/tax_rate.rb' + - 'app/models/spree/user.rb' + - 'app/models/spree/variant.rb' + - 'spec/support/request/shop_workflow.rb' + - 'spec/support/request/web_helper.rb' + - 'spec/system/admin/bulk_product_update_spec.rb' + - 'spec/system/admin/order_cycles/complex_editing_spec.rb' + - 'spec/system/admin/product_import_spec.rb' + - 'spec/system/admin/products_spec.rb' + - 'spec/system/admin/tag_rules_spec.rb' + - 'spec/system/consumer/shopping/shopping_spec.rb' + # Offense count: 22 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/RedundantPresenceValidationOnBelongsTo: @@ -617,6 +647,12 @@ Rails/RootPathnameMethods: - 'spec/models/terms_of_service_file_spec.rb' - 'spec/system/admin/configuration/terms_of_service_files_spec.rb' +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/SelectMap: + Exclude: + - 'app/models/enterprise.rb' + # Offense count: 4 # Configuration parameters: ForbiddenMethods, AllowedMethods. # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all @@ -633,7 +669,7 @@ Rails/SquishedSQLHeredocs: - 'app/queries/outstanding_balance.rb' - 'spec/queries/outstanding_balance_spec.rb' -# Offense count: 3 +# Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -642,8 +678,10 @@ Rails/TimeZone: - 'app/models/spree/gateway/pay_pal_express.rb' - 'spec/controllers/spree/credit_cards_controller_spec.rb' - 'spec/services/customer_order_cancellation_spec.rb' + - 'spec/services/order_cycle_webhook_service_spec.rb' # Offense count: 1 +# Configuration parameters: TransactionMethods. Rails/TransactionExitStatement: Exclude: - 'app/services/place_proxy_order.rb' @@ -666,6 +704,18 @@ Rails/UnknownEnv: Exclude: - 'app/models/spree/app_configuration.rb' +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Severity. +Rails/UnusedRenderContent: + Exclude: + - 'app/controllers/admin/bulk_line_items_controller.rb' + - 'app/controllers/admin/tag_rules_controller.rb' + - 'app/controllers/api/v0/enterprise_fees_controller.rb' + - 'app/controllers/api/v0/products_controller.rb' + - 'app/controllers/api/v0/taxons_controller.rb' + - 'app/controllers/api/v0/variants_controller.rb' + # Offense count: 56 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/WhereEquals: