mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
rubocop: fix offences of the Performance/RedundantMatch cop
This commit is contained in:
parent
bd25747bb7
commit
6b959bccdd
2 changed files with 1 additions and 7 deletions
|
@ -169,12 +169,6 @@ Naming/MemoizedInstanceVariableName:
|
|||
Naming/UncommunicativeMethodParamName:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Performance/RedundantMatch:
|
||||
Exclude:
|
||||
- 'lib/pry/command.rb'
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: MaxKeyValuePairs.
|
||||
|
|
|
@ -305,7 +305,7 @@ class Pry
|
|||
# the current scope.
|
||||
def check_for_command_collision(command_match, arg_string)
|
||||
collision_type = target.eval("defined?(#{command_match})")
|
||||
collision_type ||= 'local-variable' if arg_string.match(%r{\A\s*[-+*/%&|^]*=})
|
||||
collision_type ||= 'local-variable' if arg_string =~ %r{\A\s*[-+*/%&|^]*=}
|
||||
|
||||
if collision_type
|
||||
output.puts(
|
||||
|
|
Loading…
Reference in a new issue