From a97e2088817421dd39ef468b24953733e81e555d Mon Sep 17 00:00:00 2001 From: Neal Chambers Date: Mon, 24 Jul 2023 23:41:03 +0900 Subject: [PATCH] Safely autocorrect Layout/MultilineBlockLayout Inspecting 1479 files ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. Offenses: engines/order_management/app/services/order_management/subscriptions/validator.rb:101:9: C: [Corrected] Layout/IndentationWidth: Use 2 (not 12) spaces for indentation. sli.quantity > 0 && !sli.marked_for_destruction? ^^^^^^^^^^^^ engines/order_management/app/services/order_management/subscriptions/validator.rb:101:11: C: [Corrected] Layout/MultilineBlockLayout: Block argument expression is not on the same line as the block start. |sli| sli.quantity > 0 && !sli.marked_for_destruction? ^^^^^ 1479 files inspected, 2 offenses detected, 2 offenses corrected --- .rubocop_todo.yml | 6 ------ .../services/order_management/subscriptions/validator.rb | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 16ce5f1f97..4bdd854b43 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -34,12 +34,6 @@ Layout/LineLength: - 'spec/system/consumer/shopping/cart_spec.rb' - 'spec/system/consumer/shopping/products_spec.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Layout/MultilineBlockLayout: - Exclude: - - 'engines/order_management/app/services/order_management/subscriptions/validator.rb' - # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. diff --git a/engines/order_management/app/services/order_management/subscriptions/validator.rb b/engines/order_management/app/services/order_management/subscriptions/validator.rb index cd5bfd774f..e9eab98a6e 100644 --- a/engines/order_management/app/services/order_management/subscriptions/validator.rb +++ b/engines/order_management/app/services/order_management/subscriptions/validator.rb @@ -97,8 +97,8 @@ module OrderManagement end def subscription_line_items_present? - return if subscription_line_items.any? { - |sli| sli.quantity > 0 && !sli.marked_for_destruction? + return if subscription_line_items.any? { |sli| + sli.quantity > 0 && !sli.marked_for_destruction? } errors.add(:subscription_line_items, :at_least_one_product)