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: refactor HEAD-only formula handling #19338

Merged
merged 2 commits into from
Feb 21, 2025

Conversation

samford
Copy link
Member

@samford samford commented Feb 19, 2025

  • 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?

The existing code for handling a HEAD-only formula involves two return values that can be nil but this isn't apparent because the related methods aren't typed. This adds type signatures to the methods and updates the livecheck code to account for nil return values (making it clear which methods can return nil). This addresses T.must usage in the same code in #19323.

Besides that, this also extracts the "Unable to get versions" error message into a constant, like NO_CURRENT_VERSION_MSG.

Copy link
Member

@p-linnane p-linnane left a comment

Choose a reason for hiding this comment

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

Makes sense. Thanks!

@samford samford mentioned this pull request Feb 19, 2025
7 tasks
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Some suggested style tweaks but feel free to merge with/without without a rereview.

samford and others added 2 commits February 20, 2025 22:39
The existing code for handling a `HEAD`-only formula involves two
return values that can be `nil` but this isn't apparent because the
related methods aren't typed. This adds type signatures to the
methods and updates the livecheck code to account for `nil` return
values (making it clear which methods can return `nil`).

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@samford samford force-pushed the livecheck/refactor-head-only-formula branch from cd648a0 to 6cfe151 Compare February 21, 2025 03:40
@samford
Copy link
Member Author

samford commented Feb 21, 2025

The suggested changes make sense to me (and pass brew style, brew typecheck, etc.), so I've integrated them in the latest push. I didn't see any issues when testing this locally (with brew livecheck), so I'm going to go ahead and merge. Thanks!

@samford samford added this pull request to the merge queue Feb 21, 2025
Merged via the queue into master with commit 7e182d0 Feb 21, 2025
30 checks passed
@samford samford deleted the livecheck/refactor-head-only-formula branch February 21, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants