diff --git a/.rubocop_styleguide.yml b/.rubocop_styleguide.yml index ead7f299be..7f80e7d866 100644 --- a/.rubocop_styleguide.yml +++ b/.rubocop_styleguide.yml @@ -86,6 +86,10 @@ Metrics/MethodLength: Enabled: true Max: 25 # default 10 +Naming/MemoizedInstanceVariableName: + Exclude: + - 'lib/open_food_network/address_finder.rb' + Metrics/ParameterLists: CountKeywordArgs: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d20c350e60..a81cc0e150 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -221,16 +221,6 @@ Metrics/PerceivedComplexity: - 'app/models/spree/ability.rb' - 'app/models/spree/order/checkout.rb' -# Offense count: 5 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyleForLeadingUnderscores. -# SupportedStylesForLeadingUnderscores: disallowed, required, optional -Naming/MemoizedInstanceVariableName: - Exclude: - - 'app/mailers/producer_mailer.rb' - - 'app/models/concerns/balance.rb' - - 'lib/open_food_network/address_finder.rb' - # Offense count: 1 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index 104e3adc41..33254405f0 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -59,7 +59,7 @@ class ProducerMailer < ApplicationMailer end def line_items_from(order_cycle, producer) - @line_items ||= Spree::LineItem. + @line_items_from ||= Spree::LineItem. includes(variant: :product). joins(variant: :product). from_order_cycle(order_cycle). diff --git a/app/models/concerns/balance.rb b/app/models/concerns/balance.rb index af70eacce5..58f89c45b3 100644 --- a/app/models/concerns/balance.rb +++ b/app/models/concerns/balance.rb @@ -9,7 +9,7 @@ module Balance # Branches by the OrderBalance abstraction def outstanding_balance - @order_balance ||= OrderBalance.new(self) + @outstanding_balance ||= OrderBalance.new(self) end # Returns the order balance by considering the total as money owed to the order distributor aka.