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
development_tools: add type signatures #12149
Conversation
Library/Homebrew/os/mac/xcode.rb
Outdated
# Returns a Pathname object corresponding to Xcode.app's Developer | ||
# directory or nil if Xcode.app is not installed. | ||
sig { returns(Pathname) } |
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.
Given the comment here:
# Returns a Pathname object corresponding to Xcode.app's Developer | |
# directory or nil if Xcode.app is not installed. | |
sig { returns(Pathname) } | |
# Returns a Pathname object corresponding to Xcode.app's Developer | |
# directory or nil if Xcode.app is not installed. | |
sig { returns(T.nilable(Pathname)) } |
Not entirely sure why Sorbet doesn't notice that however?
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.
Pathname#cleanpath
returns T.untyped
. Opened sorbet/sorbet#4660.
tmp = Pathname.new(dir).cleanpath
T.assert_type! tmp, Pathname
tmp
Expected a type but found T.untyped for T.assert_type! https://srb.help/7007
106 | T.assert_type! tmp, Pathname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -62,6 +64,7 @@ def custom_installation_instructions | |||
EOS | |||
end | |||
|
|||
sig { returns(T::Hash[String, T.untyped]) } |
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.
sig { returns(T::Hash[String, T.untyped]) } | |
sig { returns(T::Hash[String, T.nilable(String)]) } |
@@ -20,6 +21,7 @@ def default_compiler | |||
:gcc | |||
end | |||
|
|||
sig { returns(T::Hash[String, T.untyped]) } |
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.
sig { returns(T::Hash[String, T.untyped]) } | |
sig { returns(T::Hash[String, T.nilable(String)]) } |
and probably append .to_s.presence
to Glibc version and .to_s
to oldest CPU.
def subversion_handles_most_https_certificates? | ||
true | ||
end | ||
|
||
sig { returns(T::Hash[String, T.untyped]) } |
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.
sig { returns(T::Hash[String, T.untyped]) } | |
sig { returns(T::Hash[String, T.nilable(String)]) } |
and append .to_s
to CPU family.
installation_instructions | ||
end | ||
|
||
# TODO: This method appears to be unused. Can it be deleted? |
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.
Yes, I think so.
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.
Great work! I'm happy when @Bo98 is.
Thanks! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?