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
Enable UnpackStrategy types #15025
Enable UnpackStrategy types #15025
Conversation
Review period will end on 2023-03-21 at 22:14:20 UTC. |
421c86b
to
877af48
Compare
Library/Homebrew/extend/pathname.rb
Outdated
else | ||
# Length of the longest regex (currently Tar). | ||
# The `T.let` is a workaround until we have https://github.com/sorbet/sorbet/pull/6865 | ||
T.let(binread(262), T.nilable(String)) || "" |
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.
262 was formerly MAX_MAGIC_NUMBER_LENGTH
, but i didn't want to add more than necessary to the Pathname
space, or add any redirection.
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.
@dduugg please make it a named variable at least instead for readability, thanks!
T.let(binread(262), T.nilable(String)) || "" | |
max_magic_number_length = 262 | |
T.let(binread(max_magic_number_length), T.nilable(String)) || "" |
Library/Homebrew/extend/pathname.rb
Outdated
"" | ||
else | ||
# Length of the longest regex (currently Tar). | ||
# The `T.let` is a workaround until we have https://github.com/sorbet/sorbet/pull/6865 |
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.
# The `T.let` is a workaround until we have https://github.com/sorbet/sorbet/pull/6865 | |
# FIXME: The `T.let` is a workaround until we have https://github.com/sorbet/sorbet/pull/6865 |
Review period ended. |
b37c313
to
91afda6
Compare
Updated PR to address comments and fix merge conflicts. PTAL @reitermarkus @MikeMcQuaid |
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.
Looks good! If my one suggestion is correct: please apply it and merge/enable auto-merge without another round of review being needed. Feel free to wait for @reitermarkus if desired.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Pathname
refinements in two modules,PathnameEachDirectory
andBom
, that were confined to the file they were defined in, and which better written as utility functions.Pathname
refinements in another module,Magic
, to monkey-patchPathname
instead. (This was already being included in 34 files, so it was already basically a monkey-patch). Monkey-patching isn't great, but it's still generally better than using refinements for reasons discussed in Use ActiveSupport Hash#assert_valid_keys instead of refinement #15018