Skip to content

Commit

Permalink
Fix sorbet tying error in bundler/file_updater/gemspec_sanitizer.rb (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
amazimbe authored Jan 27, 2025
1 parent 97573d2 commit 3c12659
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions bundler/lib/dependabot/bundler/file_updater/gemspec_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def replace_version_assignments(node)
node.children.each { |child| replace_version_assignments(child) }
end

sig { params(node: T.nilable(Parser::AST::Node)).void }
sig { params(node: ParserNode).void }
def replace_version_constant_references(node)
return unless node.is_a?(Parser::AST::Node)

Expand Down Expand Up @@ -152,7 +152,7 @@ def replace_require_paths_assignments(node)
end
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_assigns_to_version_constant?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -165,7 +165,7 @@ def node_assigns_to_version_constant?(node)
node_interpolates_version_constant?(node.children.last)
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_assigns_files_to_var?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -175,7 +175,7 @@ def node_assigns_files_to_var?(node)
node_dynamically_lists_files?(node.children[2])
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_dynamically_lists_files?(node)
return false unless node.is_a?(Parser::AST::Node)

Expand All @@ -184,7 +184,7 @@ def node_dynamically_lists_files?(node)
node.type == :block && node.children.first&.type == :send
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_assigns_require_paths?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -193,7 +193,7 @@ def node_assigns_require_paths?(node)
node.children[1] == :require_paths=
end

sig { params(node: T.nilable(T.any(Parser::AST::Node, Symbol, String))).void }
sig { params(node: ParserNode).void }
def replace_file_reads(node)
return unless node.is_a?(Parser::AST::Node)
return if node.children[1] == :version=
Expand All @@ -203,7 +203,7 @@ def replace_file_reads(node)
node.children.each { |child| replace_file_reads(child) }
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_reads_a_file?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -213,7 +213,7 @@ def node_reads_a_file?(node)
node.children[1] == :read
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_uses_readlines?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -223,7 +223,7 @@ def node_uses_readlines?(node)
node.children[1] == :readlines
end

sig { params(node: T.nilable(T.any(Parser::AST::Node, Symbol, String))).void }
sig { params(node: ParserNode).void }
def replace_json_parses(node)
return unless node.is_a?(Parser::AST::Node)
return if node.children[1] == :version=
Expand All @@ -232,7 +232,7 @@ def replace_json_parses(node)
node.children.each { |child| replace_json_parses(child) }
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_parses_json?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -242,7 +242,7 @@ def node_parses_json?(node)
node.children[1] == :parse
end

sig { params(node: T.nilable(T.any(Parser::AST::Node, Symbol, String))).void }
sig { params(node: ParserNode).void }
def remove_find_dot_find_args(node)
return unless node.is_a?(Parser::AST::Node)
return if node.children[1] == :version=
Expand All @@ -251,7 +251,7 @@ def remove_find_dot_find_args(node)
node.children.each { |child| remove_find_dot_find_args(child) }
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_calls_find_dot_find?(node)
return false unless node.is_a?(Parser::AST::Node)
return false unless node.children.first.is_a?(Parser::AST::Node)
Expand All @@ -277,7 +277,7 @@ def remove_unnecessary_assignments(node)
end
end

sig { params(node: T.nilable(Parser::AST::Node)).returns(T::Boolean) }
sig { params(node: ParserNode).returns(T::Boolean) }
def node_includes_heredoc?(node)
!!find_heredoc_end_range(node)
end
Expand All @@ -287,7 +287,7 @@ def node_includes_heredoc?(node)
#
# Returns a Parser::Source::Range identifying the location of the end
# of the heredoc, or nil if no heredoc was found.
sig { params(node: T.nilable(Parser::AST::Node)).returns(T.nilable(Parser::Source::Range)) }
sig { params(node: ParserNode).returns(T.nilable(Parser::Source::Range)) }
def find_heredoc_end_range(node)
return unless node.is_a?(Parser::AST::Node)

Expand Down

0 comments on commit 3c12659

Please sign in to comment.