Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strictly type file #8384

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions common/lib/dependabot/config/file.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: true
# typed: strict
# frozen_string_literal: true

require "dependabot/config/update_config"
Expand All @@ -10,11 +10,22 @@ module Config
class File
extend T::Sig

attr_reader :updates, :registries
sig { returns(T::Array[T::Hash[Symbol, String]]) }
attr_reader :updates

sig { returns T::Array[T.untyped] }
attr_reader :registries

sig do
params(
updates: T.nilable(T::Array[T::Hash[Symbol, String]]),
registries: T.nilable(T::Array[T.untyped])
)
.void
end
def initialize(updates:, registries: nil)
@updates = updates || []
@registries = registries || []
@updates = T.let(updates || [], T::Array[T::Hash[Symbol, String]])
@registries = T.let(registries || [], T::Array[T.untyped])
end

sig do
Expand Down