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

Sorbet updates for compatibility with recent releases #16183

Merged
merged 8 commits into from Nov 6, 2023

Conversation

dduugg
Copy link
Sponsor Member

@dduugg dduugg commented Nov 5, 2023

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run 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.

@@ -1,5 +1,6 @@
# typed: strict

module Predicable
requires_ancestor { Class }
Copy link
Sponsor Member Author

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?
Copy link
Sponsor Member Author

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"))
Copy link
Sponsor Member Author

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.)

@p-linnane p-linnane requested a review from Bo98 November 5, 2023 17:27
@Bo98
Copy link
Member

Bo98 commented Nov 5, 2023

Feel free to close out for now, if this feels like jumping the gun.

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.

Comment on lines 544 to 551
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
Copy link
Member

@Bo98 Bo98 Nov 5, 2023

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.

Copy link
Sponsor Member Author

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

@EricFromCanada EricFromCanada changed the title Sorbet updates for compatibility with recent relesases Sorbet updates for compatibility with recent releases Nov 6, 2023
@MikeMcQuaid MikeMcQuaid merged commit d4bf3b0 into Homebrew:master Nov 6, 2023
28 checks passed
@MikeMcQuaid
Copy link
Member

Thanks again @dduugg and thanks for eagle-eyed review @Bo98!

@github-actions github-actions bot added the outdated PR was locked due to age label Dec 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants