From a1600a72b7ca8dc565fc41738e4c9ab8bc489af3 Mon Sep 17 00:00:00 2001 From: tombonan Date: Tue, 1 Aug 2023 13:16:44 -0600 Subject: [PATCH] [chore] Enable new cops by default and fix failures --- .rubocop.yml | 1 + lib/memoize_block.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 193275d..7bdb9eb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ AllCops: Include: - 'lib/**/*' - 'spec/**/*' + NewCops: enable Layout/LineLength: Max: 120 diff --git a/lib/memoize_block.rb b/lib/memoize_block.rb index 1c48f1c..a116738 100644 --- a/lib/memoize_block.rb +++ b/lib/memoize_block.rb @@ -23,7 +23,7 @@ module MemoizeBlock # end # def memoize(ivar_name = nil) - ivar_name = ivar_name.nil? ? caller_locations[0].label : ivar_name + ivar_name = caller_locations[0].label if ivar_name.nil? raise 'invalid ivar name' if ivar_name.match(/@|!/)