diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 744f52c2ee..fe568c15a8 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -323,11 +323,6 @@ Lint/DuplicateBranch: - "/**/{Formula,Casks}/*.rb" - "**/{Formula,Casks}/*.rb" -# needed for lazy_object magic -Naming/MemoizedInstanceVariableName: - Exclude: - - "Homebrew/lazy_object.rb" - # useful for metaprogramming in RSpec Lint/ConstantDefinitionInBlock: Exclude: diff --git a/Library/Homebrew/lazy_object.rb b/Library/Homebrew/lazy_object.rb index 550c696387..4dfcbdb4e6 100644 --- a/Library/Homebrew/lazy_object.rb +++ b/Library/Homebrew/lazy_object.rb @@ -10,9 +10,11 @@ class LazyObject < Delegator end def __getobj__ + # rubocop:disable Naming/MemoizedInstanceVariableName return @__delegate__ if defined?(@__delegate__) @__delegate__ = @__callable__.call + # rubocop:enable Naming/MemoizedInstanceVariableName end def __setobj__(callable)