Class: RuboCop::Cop::Sorbet::KeywordArgumentOrdering
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sorbet::KeywordArgumentOrdering
- Includes:
- SignatureHelp
- Defined in:
- lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb
Overview
Checks for the ordering of keyword arguments required by sorbet-runtime. The ordering requires that all keyword arguments are at the end of the parameters list, and all keyword arguments with a default value must be after those without default values.
Instance Method Summary collapse
Methods included from SignatureHelp
#on_block, #signature?, #with_runtime?, #without_runtime?
Instance Method Details
#on_signature(node) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb', line 23 def on_signature(node) method_node = node.parent.children[node.sibling_index + 1] return if method_node.nil? method_parameters = method_node.arguments check_order_for_kwoptargs(method_parameters) end |