Merge pull request #13285 from cyrillefr/FixRubocopNamingMemoizedInstanceVariableName

Fixes Rubocop Naming NamingMemoizedInstanceVariableName cop
This commit is contained in:
David Cook
2025-05-05 12:48:28 +10:00
committed by GitHub
4 changed files with 6 additions and 12 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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).

View File

@@ -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.