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
livecheck: compare actual version for casks #10348
livecheck: compare actual version for casks #10348
Conversation
Review period will end on 2021-01-19 at 00:00:00 UTC. |
@@ -243,6 +249,8 @@ def formula_or_cask_name(formula_or_cask, full_name: false) | |||
formula_name(formula_or_cask, full_name: full_name) | |||
when Cask::Cask | |||
cask_name(formula_or_cask, full_name: full_name) | |||
else | |||
T.absurd(formula_or_cask) |
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.
What's this do?
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.
If we ever change the type of formula_or_cask
from
T.any(Formula, Cask::Cask)
to say,
T.any(Formula, Cask::Cask, Thing)
then Sorbet will give an error since we don't handle the case for when formula_or_cask
is a Thing
(Admittedly, this is a bit redundant since the name formula_or_cask
itself implies that it can only be a Formula
or Cask
)
Related: https://sorbet.org/docs/exhaustiveness
T.absurd(...)
is implemented both statically and at runtime. Statically Sorbet will report an error, and at runtime Sorbet will raise an exception.
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.
Should I delete?
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.
I don't feel strongly either way, up to you! Thanks for explaining ❤️
Review period ended. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?Tested with Homebrew/homebrew-cask#98130
Before:
After: