Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enable strict typing in DependenciesHelpers #19314

Merged
merged 3 commits into from
Feb 18, 2025
Merged

Enable strict typing in DependenciesHelpers #19314

merged 3 commits into from
Feb 18, 2025

Conversation

dduugg
Copy link
Member

@dduugg dduugg commented Feb 16, 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?

…long with some related fixes (removing module_function use, improving type contracts)

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!

@dduugg dduugg added this pull request to the merge queue Feb 18, 2025
Merged via the queue into master with commit cf635bc Feb 18, 2025
30 checks passed
@dduugg dduugg deleted the typed-dep-helpers branch February 18, 2025 18:57
@carlocab
Copy link
Member

carlocab commented Feb 19, 2025

I think this broke brew uses. Try:

$ brew uses --installed hello
Error: Parameter 'dependables': Expected type T.any(Dependencies, Requirements), got type Array with value []
Caller: /opt/homebrew/Library/Homebrew/cmd/uses.rb:165
Definition: /opt/homebrew/Library/Homebrew/dependencies_helpers.rb:73 (DependenciesHelpers#select_includes)
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/configuration.rb:296:in `call_validation_error_handler_default'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/configuration.rb:303:in `call_validation_error_handler'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:322:in `report_error'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:230:in `block in validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/signature.rb:213:in `each_args_value_type'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:227:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/cmd/uses.rb:165:in `block in select_used_dependents'
/opt/homebrew/Library/Homebrew/cmd/uses.rb:161:in `select'
/opt/homebrew/Library/Homebrew/cmd/uses.rb:161:in `select_used_dependents'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/cmd/uses.rb:114:in `intersection_of_dependents'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/cmd/uses.rb:85:in `run'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `bind_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/call_validation.rb:282:in `validate_call'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11834/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
/opt/homebrew/Library/Homebrew/brew.rb:95:in `<main>'
Please report this issue:
  https://docs.brew.sh/Troubleshooting

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants