-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
refactor: update type signatures to always return boolean for install… #20860
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
refactor: update type signatures to always return boolean for install… #20860
Conversation
e76825a
to
8d506bc
Compare
7463539
to
542b11b
Compare
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! A few tweaks.
…ed_as_dependency and installed_on_request
- installed_on_request_present? - installed_as_dependency_present?
542b11b
to
eb6ee32
Compare
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.
Pull Request Overview
This PR refactors the installed_as_dependency
and installed_on_request
attributes in the Tab
class to always return boolean values instead of nullable booleans. The change introduces new tracking methods to distinguish between explicitly set false values and unset/missing values.
- Added
installed_on_request_present?
andinstalled_as_dependency_present?
methods to track whether these attributes were explicitly set - Updated type signatures from
T.nilable(T::Boolean)
toT::Boolean
with default values offalse
- Modified the autoremove logic to check for presence before evaluating the boolean value
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
Library/Homebrew/tab.rb | Added presence tracking for dependency/request attributes, updated type signatures to non-nullable booleans, and added new predicate methods |
Library/Homebrew/utils/autoremove.rb | Updated unused formula detection to check for attribute presence before evaluating boolean values |
Library/Homebrew/test/utils/autoremove_spec.rb | Updated test mocks to include the new installed_on_request_present? method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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 @hyuraku!
…ed_as_dependency and installed_on_request
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?solve the comment
# TODO: change this to always return a boolean