From 7f4542222541a1651661565d84e66a4329e4169c Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Sun, 28 Mar 2021 17:40:07 +0300 Subject: [PATCH] Document that we allow parens where omitting them is ambiguous or invalid --- .../cop/style/method_call_with_args_parentheses.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rubocop/cop/style/method_call_with_args_parentheses.rb b/lib/rubocop/cop/style/method_call_with_args_parentheses.rb index 7db2ccf5caf5..b8deed03fbf1 100644 --- a/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +++ b/lib/rubocop/cop/style/method_call_with_args_parentheses.rb @@ -40,8 +40,12 @@ module Style # to `true` allows the presence of parentheses in such a method call # even with arguments. # - # NOTE: Parens are required around a method with arguments when inside an - # endless method definition (>= Ruby 3.0). + # NOTE: Parentheses are still allowed in cases where omitting them + # results in ambiguous or syntactically incorrect code. For example, + # parentheses are required around a method with arguments when inside an + # endless method definition introduced in Ruby 3.0. Parentheses are also + # allowed when forwarding arguments with the triple-dot syntax introduced + # in Ruby 2.7 as omitting them starts an endless range. # # @example EnforcedStyle: require_parentheses (default) #