Skip to content

Commit

Permalink
[Fixes #9487] Mark Naming/MemoizedInstanceVariableName as unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre authored and mergify[bot] committed Mar 17, 2021
1 parent 6746f15 commit 255692c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
@@ -0,0 +1 @@
* [#9487](https://github.com/rubocop/rubocop/issues/9487): Mark Naming/MemoizedInstanceVariableName as unsafe. ([@marcandre][])
1 change: 1 addition & 0 deletions config/default.yml
Expand Up @@ -2490,6 +2490,7 @@ Naming/MemoizedInstanceVariableName:
- disallowed
- required
- optional
Safe: false

Naming/MethodName:
Description: 'Use the configured style when naming methods.'
Expand Down
4 changes: 4 additions & 0 deletions lib/rubocop/cop/naming/memoized_instance_variable_name.rb
Expand Up @@ -139,6 +139,10 @@ module Naming
# define_method(:foo) do
# @_foo ||= calculate_expensive_thing
# end
#
# This cop relies on the pattern `@instance_var ||= ...`,
# but this is sometimes used for other purposes than memoization
# so this cop is considered unsafe.
class MemoizedInstanceVariableName < Base
include ConfigurableEnforcedStyle

Expand Down

0 comments on commit 255692c

Please sign in to comment.