Skip to content

Commit

Permalink
Strict type Dependabot::Pub::MetaDataFinder. (#9933)
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-meka authored Jun 7, 2024
1 parent 6659621 commit 3baf968
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pub/lib/dependabot/pub/metadata_finder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true

require "excon"
Expand All @@ -14,6 +14,7 @@ module Pub
class MetadataFinder < Dependabot::MetadataFinders::Base
private

sig { override.returns(T.nilable(Dependabot::Source)) }
def look_up_source
source = dependency.requirements.first&.dig(:source)
if source&.dig("type") == "git"
Expand All @@ -34,6 +35,7 @@ def look_up_source
Source.from_url(repo)
end

sig { params(repository_url: String).returns(T::Hash[String, T.untyped]) }
def repository_listing(repository_url)
response = Dependabot::RegistryClient.get(url: "#{repository_url}/api/packages/#{dependency.name}")
JSON.parse(response.body)
Expand Down

0 comments on commit 3baf968

Please sign in to comment.