-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
help-wantedWe support this change, and welcome community contributions for it.We support this change, and welcome community contributions for it.
Description
This code:
class MyCop < ::RuboCop::Cop::Base
def_node_matcher :my_pattern?, <<~PATTERN
(send _ :some_method ...)
PATTERN
endShould produce this RBI:
class MyCop < ::RuboCop::Cop::Base
sig do
params(
node: RuboCop::AST::Node,
block: T.proc.params(*captures: T.untyped).void,
).returns(T::Boolean)
end
def my_pattern?; end
endTyping the block would be pretty challenging... we'd need to statically analyze the NodePattern, to figure out how many matches where will be. I just left it as an untyped varargs.
Metadata
Metadata
Assignees
Labels
help-wantedWe support this change, and welcome community contributions for it.We support this change, and welcome community contributions for it.