Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Dec 13, 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 lgtm (style, typechecking and tests) with your changes locally?

Part of

Copilot AI review requested due to automatic review settings December 13, 2025 03:07
Copy link
Contributor

Copilot AI left a 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 enables Sorbet strict type checking for several cask-related files (cask/tab.rb, cask/pkg.rb, cask/staged.rb, and cask/utils.rb) as part of the broader effort to add strict typing across the Homebrew codebase. The changes add explicit type signatures to methods, properly annotate memoized instance variables, and make related adjustments to ensure type safety.

Key changes:

  • Upgraded type annotations from typed: true to typed: strict in cask utility files
  • Added explicit Sorbet method signatures throughout the modified files
  • Replaced direct instance variable access with attr_reader accessors to support strict typing

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Library/Homebrew/cask/utils.rb Enabled strict typing, added method signatures for permission management utilities, changed dir.writable? to dir&.writable? for nil safety
Library/Homebrew/cask/tab.rb Enabled strict typing, added signature for runtime_deps_hash method
Library/Homebrew/cask/staged.rb Enabled strict typing, changed instance variable references to use cask and command accessors
Library/Homebrew/cask/pkg.rb Enabled strict typing, added T.let annotations to memoized instance variables, added method signatures
Library/Homebrew/unversioned_cask_checker.rb Added Pathname() conversion in ensure blocks for type safety when calling gain_permissions_remove
Library/Homebrew/cask/installer.rb Changed T::Class[SystemCommand] to T.class_of(SystemCommand) for consistency
Library/Homebrew/cask/dsl/base.rb Added explicit attr_reader signatures for cask and command to support strict typing
Library/Homebrew/cask/artifact/abstract_uninstall.rb Added Pathname() conversion for path parameter passed to gain_permissions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Thanks again @cho-m!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 13, 2025
Merged via the queue into main with commit c5e2186 Dec 13, 2025
62 of 63 checks passed
@MikeMcQuaid MikeMcQuaid deleted the cask-typed-strict branch December 13, 2025 13:17
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.

4 participants