Add extend/node.rbi, remove unused methods

This commit is contained in:
Douglas Eichelberger 2024-02-04 05:46:18 -08:00
parent 09f5a46218
commit b010e397d6
2 changed files with 21 additions and 6 deletions

View File

@ -8,17 +8,11 @@ module RuboCop
include RuboCop::Cask::Constants include RuboCop::Cask::Constants
def_node_matcher :method_node, "{$(send ...) (block $(send ...) ...)}" def_node_matcher :method_node, "{$(send ...) (block $(send ...) ...)}"
def_node_matcher :block_args, "(block _ $_ _)"
def_node_matcher :block_body, "(block _ _ $_)" def_node_matcher :block_body, "(block _ _ $_)"
def_node_matcher :key_node, "{(pair $_ _) (hash (pair $_ _) ...)}"
def_node_matcher :val_node, "{(pair _ $_) (hash (pair _ $_) ...)}"
def_node_matcher :cask_block?, "(block (send nil? :cask ...) args ...)" def_node_matcher :cask_block?, "(block (send nil? :cask ...) args ...)"
def_node_matcher :on_system_block?, def_node_matcher :on_system_block?,
"(block (send nil? {#{ON_SYSTEM_METHODS.map(&:inspect).join(" ")}} ...) args ...)" "(block (send nil? {#{ON_SYSTEM_METHODS.map(&:inspect).join(" ")}} ...) args ...)"
def_node_matcher :arch_variable?, "(lvasgn _ (send nil? :on_arch_conditional ...))" def_node_matcher :arch_variable?, "(lvasgn _ (send nil? :on_arch_conditional ...))"
def_node_matcher :begin_block?, "(begin ...)" def_node_matcher :begin_block?, "(begin ...)"
sig { returns(T::Boolean) } sig { returns(T::Boolean) }

View File

@ -0,0 +1,21 @@
# typed: strict
class RuboCop::AST::Node
sig { returns(T::Boolean) }
def arch_variable?; end
sig { returns(T::Boolean) }
def begin_block?; end
sig { returns(T.nilable(RuboCop::AST::Node)) }
def block_body; end
sig { returns(T::Boolean) }
def cask_block?; end
sig { returns(T.nilable(RuboCop::AST::Node)) }
def method_node; end
sig { returns(T::Boolean) }
def on_system_block?; end
end