From 0ec3ee39caaaecd0c5554c55263a8267f7987756 Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Mon, 22 Mar 2021 10:42:35 +0200 Subject: [PATCH] Document cases where parens are accepted even in `omit_parentheses` style --- .../method_call_with_args_parentheses.rb | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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 06e307bf49f..7db2ccf5caf 100644 --- a/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +++ b/lib/rubocop/cop/style/method_call_with_args_parentheses.rb @@ -79,6 +79,30 @@ module Style # # good # foo.enforce strict: true # + # # good + # # Allows parens for calls that won't produce valid Ruby or be ambiguous. + # model.validate strict(true) + # + # # good + # # Allows parens for calls that won't produce valid Ruby or be ambiguous. + # yield path, File.basename(path) + # + # # good + # # Operators methods calls with parens + # array&.[](index) + # + # # good + # # Operators methods without parens, if you prefer + # array.[] index + # + # # good + # # Operators methods calls with parens + # array&.[](index) + # + # # good + # # Operators methods without parens, if you prefer + # array.[] index + # # @example IgnoreMacros: true (default) # # # good