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

livecheck: compare actual version for casks #10348

Merged

Conversation

SeekingMeaning
Copy link
Contributor

  • 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?
  • Have you successfully run brew man locally and committed any changes?

Tested with Homebrew/homebrew-cask#98130

Before:

$ brew livecheck --cask adoptopenjdk
adoptopenjdk : 15.0.1,9.1 ==> 15,36

After:

$ brew livecheck --cask adoptopenjdk
adoptopenjdk : 15.0.1,9.1 ==> 15.0.1,9

@BrewTestBot
Copy link
Member

Review period will end on 2021-01-19 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 17, 2021
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this do?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I delete?

Copy link
Member

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 ❤️

@BrewTestBot
Copy link
Member

Review period ended.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 19, 2021
@SeekingMeaning SeekingMeaning merged commit e42e981 into Homebrew:master Jan 20, 2021
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Feb 20, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 20, 2021
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