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
Enable typing in Ignorable #15114
Enable typing in Ignorable #15114
Conversation
@@ -99,7 +99,7 @@ def self.debrew | |||
end | |||
|
|||
def self.debug(exception) | |||
raise(exception) if !active? || !debugged_exceptions.add?(exception) || !try_lock | |||
raise(exception) if !active? || !debugged_exceptions.add?(exception) || !mu_try_lock |
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 switches to using the mu_
methods bc sorbet doesn't recognize the aliased versions, but I believe they are equivalent:
[1] brew(main)> require 'debrew'
=> true
[2] brew(main)> $ Debrew.try_lock
From: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mutex_m.rb:86:
Owner: #<Class:Debrew>
Visibility: public
Signature: try_lock()
Number of lines: 3
def mu_try_lock
@_mutex.try_lock
end
@@ -54,7 +54,7 @@ def self.update_test | |||
start_commit = T.let("", T.untyped) | |||
end_commit = "HEAD" | |||
cd HOMEBREW_REPOSITORY do | |||
start_commit = if (commit = T.let(args.commit, T.nilable(String))) | |||
start_commit = if (commit = args.commit) |
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.
Follow-up to #15104 (comment)
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.
Thanks again @dduugg!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Enables typing for the
Ignorable
andDebrew
files.Restores the upstream.rbi file to include type definitions that are necessary but not in our version of sorbet. (They're a pair of private methods, so pretending them with
T.unsafe(self)
doesn't work.)