lib/rubocop/cop/style/ternary_parentheses.rb in rubocop-0.79.0 vs lib/rubocop/cop/style/ternary_parentheses.rb in rubocop-0.80.0
- old
+ new
@@ -160,10 +160,10 @@
# When this cop is configured to enforce parentheses and the
# `RedundantParentheses` cop is enabled, it will cause an infinite loop
# as they compete to add and remove the parentheses respectively.
def infinite_loop?
- require_parentheses? &&
+ (require_parentheses? || require_parentheses_when_complex?) &&
redundant_parentheses_enabled?
end
def unsafe_autocorrect?(condition)
condition.children.any? do |child|