Class: RuboCop::Cop::Glib::MultilineMethodCallStyle
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Glib::MultilineMethodCallStyle
- Extended by:
- AutoCorrector
- Defined in:
- lib/glib/rubocop/cops/multiline_method_call_style.rb
Overview
Enforces parentheses style for multi-line method calls with arguments.
Constant Summary collapse
- MSG =
'Use parentheses style for multi-line method calls: ' \ 'wrap arguments in parentheses and place each argument on its own line.'
Instance Method Summary collapse
- #on_send(node) ⇒ Object (also: #on_csend)
Instance Method Details
#on_send(node) ⇒ Object Also known as: on_csend
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/glib/rubocop/cops/multiline_method_call_style.rb', line 36 def on_send(node) return unless multi_line_call_with_args?(node) return if proper_parentheses_style?(node) return if proper_backslash_style?(node) && allow_backslash? return if inside_correctable_parent?(node) add_offense(node) do |corrector| autocorrect(corrector, node) end end |