From 5a3a4a041fb314bd1fcaef1a7f75fb297cd67892 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 20 Jul 2023 13:50:55 +1000 Subject: [PATCH] Safely autocorrect Layout/ArrayAlignment Inspecting 1478 files ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C......................CC.........................................C................................. Offenses: spec/system/admin/customers_spec.rb:40:13: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line. managed_distributor2.name], without_options: [unmanaged_distributor.name] ^^^^^^^^^^^^^^^^^^^^^^^^^ spec/system/admin/customers_spec.rb:40:101: C: Layout/LineLength: Line is too long. [126/100] managed_distributor2.name], without_options: [unmanaged_distributor.name] ^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/system/admin/order_spec.rb:742:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line. different_shipping_method_for_distributor1] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/system/admin/orders_spec.rb:48:33: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line. distributor3, distributor4], ^^^^^^^^^^^^ spec/system/consumer/shopping/cart_spec.rb:21:37: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line. product_with_fee.variants.first]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1478 files inspected, 5 offenses detected, 4 offenses corrected --- .rubocop_todo.yml | 22 +++++++--------------- spec/system/admin/customers_spec.rb | 2 +- spec/system/admin/order_spec.rb | 2 +- spec/system/admin/orders_spec.rb | 2 +- spec/system/consumer/shopping/cart_spec.rb | 2 +- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6c80f6e0ca..93241451a0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -16,17 +16,6 @@ Gemspec/RequiredRubyVersion: - 'engines/order_management/order_management.gemspec' - 'engines/web/web.gemspec' -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: with_first_element, with_fixed_indentation -Layout/ArrayAlignment: - Exclude: - - 'spec/system/admin/customers_spec.rb' - - 'spec/system/admin/order_spec.rb' - - 'spec/system/admin/orders_spec.rb' - - 'spec/system/consumer/shopping/cart_spec.rb' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleAlignWith. @@ -87,7 +76,7 @@ Layout/FirstHashElementIndentation: Exclude: - 'spec/services/products_renderer_spec.rb' -# Offense count: 13 +# Offense count: 9 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table @@ -96,13 +85,11 @@ Layout/FirstHashElementIndentation: Layout/HashAlignment: Exclude: - 'app/controllers/spree/users_controller.rb' - - 'spec/migrations/migrate_customer_names_spec.rb' - 'spec/models/enterprise_spec.rb' - 'spec/system/admin/customers_spec.rb' - 'spec/system/admin/order_spec.rb' - 'spec/system/admin/orders_spec.rb' - 'spec/system/admin/tag_rules_spec.rb' - - 'spec/system/consumer/shopping/cart_spec.rb' # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). @@ -137,7 +124,7 @@ Layout/LineContinuationSpacing: - 'spec/system/admin/enterprise_fees_spec.rb' - 'spec/system/admin/order_spec.rb' -# Offense count: 77 +# Offense count: 91 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https @@ -151,6 +138,7 @@ Layout/LineLength: - 'spec/controllers/api/v0/order_cycles_controller_spec.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' - 'spec/lib/reports/customers_report_spec.rb' + - 'spec/migrations/migrate_customer_names_spec.rb' - 'spec/models/enterprise_spec.rb' - 'spec/models/order_cycle_spec.rb' - 'spec/models/product_importer_spec.rb' @@ -160,11 +148,15 @@ Layout/LineLength: - 'spec/models/spree/product_spec.rb' - 'spec/models/spree/variant_spec.rb' - 'spec/requests/api/orders_spec.rb' + - 'spec/services/products_renderer_spec.rb' - 'spec/support/request/web_helper.rb' - 'spec/system/admin/adjustments_spec.rb' - 'spec/system/admin/bulk_order_management_spec.rb' + - 'spec/system/admin/order_cycles/simple_spec.rb' - 'spec/system/admin/order_spec.rb' - 'spec/system/admin/product_import_spec.rb' + - 'spec/system/consumer/shopping/cart_spec.rb' + - 'spec/system/consumer/shopping/products_spec.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). diff --git a/spec/system/admin/customers_spec.rb b/spec/system/admin/customers_spec.rb index 59b5b16a86..acdd9497c3 100644 --- a/spec/system/admin/customers_spec.rb +++ b/spec/system/admin/customers_spec.rb @@ -37,7 +37,7 @@ code: nil, created_manually: true) # Prompts for a hub for a list of my managed enterprises expect(page) .to have_select2 "shop_id", with_options: [managed_distributor1.name, - managed_distributor2.name], without_options: [unmanaged_distributor.name] + managed_distributor2.name], without_options: [unmanaged_distributor.name] select2_select managed_distributor2.name, from: "shop_id" diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 7452546b2b..c64b13e1bb 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -739,7 +739,7 @@ distributors: [distributor1]) "in an existing order " do before do distributor1.shipping_methods = [shipping_method_for_distributor1, -different_shipping_method_for_distributor1] + different_shipping_method_for_distributor1] order.shipments.each(&:refresh_rates) order.shipment.adjustments.first.open order.select_shipping_method(different_shipping_method_for_distributor1) diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index e64cd0b5de..3ce0295b36 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -45,7 +45,7 @@ describe ' distributors: [distributor4, distributor5]) } let(:order_cycle) do create(:simple_order_cycle, name: 'One', distributors: [distributor, distributor2, - distributor3, distributor4], + distributor3, distributor4], variants: [product.variants.first]) end diff --git a/spec/system/consumer/shopping/cart_spec.rb b/spec/system/consumer/shopping/cart_spec.rb index 1de6615928..6e24698cd7 100644 --- a/spec/system/consumer/shopping/cart_spec.rb +++ b/spec/system/consumer/shopping/cart_spec.rb @@ -18,7 +18,7 @@ describe "full-page cart" do create(:simple_order_cycle, suppliers: [supplier], distributors: [distributor], coordinator: create(:distributor_enterprise), variants: [product_with_tax.variants.first, - product_with_fee.variants.first]) + product_with_fee.variants.first]) } let(:enterprise_fee) { create(:enterprise_fee, amount: 11.00, tax_category: product_with_tax.tax_category)