lib/rubocop/cop/style/ternary_parentheses.rb in rubocop-0.48.0 vs lib/rubocop/cop/style/ternary_parentheses.rb in rubocop-0.48.1
- old
+ new
@@ -3,11 +3,12 @@
module RuboCop
module Cop
module Style
# This cop checks for the presence of parentheses around ternary
# conditions. It is configurable to enforce inclusion or omission of
- # parentheses using `EnforcedStyle`.
+ # parentheses using `EnforcedStyle`. Omission is only enforced when
+ # removing the parentheses won't cause a different behaviour.
#
# @example
#
# EnforcedStyle: require_no_parentheses (default)
#
@@ -159,10 +160,10 @@
argument && argument !~ /^\(/
end
def_node_matcher :method_call_argument, <<-PATTERN
{(:defined? $...)
- (send {(send ...) nil} _ $(send nil _)...)}
+ (send {_ nil} _ $(send nil _)...)}
PATTERN
def_node_matcher :square_brackets?,
'(send {(send _recv _msg) str array hash} :[] ...)'