-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Sorbet updates for compatibility with recent releases #16183
Conversation
@@ -1,5 +1,6 @@ | |||
# typed: strict | |||
|
|||
module Predicable | |||
requires_ancestor { Class } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is disallowed as of sorbet/sorbet#6983
@@ -132,7 +132,7 @@ def extract_nestedly(to: nil, basename: nil, verbose: false, prioritize_extensio | |||
|
|||
children = tmp_unpack_dir.children | |||
|
|||
if children.count == 1 && !children.first.directory? | |||
if children.size == 1 && !children.fetch(0).directory? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of size
here is a minor, unrelated performance fix
bottle_json.is_a?(Hash) | ||
bottle_json.keys.first.presence | ||
else | ||
bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always true assignments in conditionals seem to be disallowed now: sorbet/sorbet#7463
(It's probably worth the reviewer's attention to check that the branching logic is unchanged.)
No, this is fine as long as it also works on the version we're running on. We won't be able to actually update until the very end. |
Library/Homebrew/software_spec.rb
Outdated
sig { params(tag: Utils::Bottles::Tag).returns(T.any(Symbol, String)) } | ||
sig { params(tag: Utils::Bottles::Tag).returns(String) } | ||
def tag_to_cellar(tag = Utils::Bottles.tag) | ||
spec = collector.specification_for(tag) | ||
if spec.present? | ||
spec.cellar | ||
spec.cellar.to_s | ||
else | ||
tag.default_cellar | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem correct. Cellar can be both a symbol (e.g. :any_skip_relocation
) and a string (path), and it looks like this is breaking CI as a result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ty! Fixed in 3c0506e
28610b3
to
57baeb8
Compare
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I noticed Ruby 3 support was rolling out, and thought these updates might be useful. Feel free to close out for now, if this feels like jumping the gun.