From 6797f30bbf2b433134318c362a8862bb34467308 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 18 Feb 2023 23:01:22 +0000 Subject: [PATCH] rubocop: In-line disables of `Naming/MemoizedInstanceVariableName` --- Library/.rubocop.yml | 5 ----- Library/Homebrew/lazy_object.rb | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) 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)