dev-cmd/bump-formula-pr: Fix types for fetch_resource_and_forced_version

- This should fix https://github.com/Homebrew/homebrew-core/actions/runs/9839505520, that is:

```
Parameter 'tag': Expected type Float, got type String with value "2024-07-05"
Caller: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11473/lib/types/private/methods/call_validation.rb:215
Definition: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:445 (Homebrew::DevCmd::BumpFormulaPr#fetch_resource_and_forced_version)
```

- I think I read https://sorbet.org/docs/sigs#rest-parameters too literally,
  yes Sorbet expands the kwargs into a hash type, but it's the value type that
  needs specifying in the sig (which for us is `String`).
This commit is contained in:
Issy Long 2024-07-08 18:46:21 +01:00
parent 8c4c7319fc
commit 517d3c9bcf
No known key found for this signature in database

View File

@ -440,7 +440,7 @@ module Homebrew
sig {
params(formula: Formula, new_version: T.nilable(String), url: String,
specs: Float).returns(T::Array[T.untyped])
specs: String).returns(T::Array[T.untyped])
}
def fetch_resource_and_forced_version(formula, new_version, url, **specs)
resource = Resource.new