Skip to content

Commit

Permalink
Configure Naming/MemoizedInstanceVariableName in source.
Browse files Browse the repository at this point in the history
Rather than turn it off for a whole file, it's better to mark these
exceptions in comments.
  • Loading branch information
hainesr committed Feb 29, 2020
1 parent f9b161e commit c30d9df
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ Metrics/MethodLength:
Exclude:
- 'test/**/*.rb'

# Rubocop confuses these as instances of "memoization".
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/zip/extra_field/old_unix.rb'
- 'lib/zip/extra_field/unix.rb'

# Set a consistent way of checking types.
Style/ClassCheck:
EnforcedStyle: kind_of?
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/extra_field/old_unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def merge(binstr)
@uid ||= uid
@gid ||= gid
@atime ||= atime
@mtime ||= mtime
@mtime ||= mtime # rubocop:disable Naming/MemoizedInstanceVariableName
end

def ==(other)
Expand Down
2 changes: 1 addition & 1 deletion lib/zip/extra_field/unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def merge(binstr)

uid, gid = content.unpack('vv')
@uid ||= uid
@gid ||= gid
@gid ||= gid # rubocop:disable Naming/MemoizedInstanceVariableName
end

def ==(other)
Expand Down

0 comments on commit c30d9df

Please sign in to comment.