cask/metadata: `typed: strict` by cho-m · Pull Request #21305 · Homebrew/brew

Pull request overview

This PR upgrades the Sorbet type checking level from typed: true to typed: strict for the cask/metadata.rb file, as part of the broader effort tracked in issue #17297. The upgrade requires adding explicit type signatures to all methods and making minor refactorings to satisfy strict type checking requirements.

Key changes:

  • Added Sorbet type signatures to all public and private methods in the Metadata module
  • Refactored metadata_timestamped_path to use a case statement for clearer control flow
  • Added defensive programming to reject invalid timestamp symbols

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/cask/metadata.rb Upgraded from typed: true to typed: strict; added type signatures to all methods; refactored metadata_timestamped_path to use case statement with defensive symbol validation
Library/Homebrew/cask/cask.rb Modified timestamped_versions to explicitly convert Pathname to string before passing to Pathname.glob, likely to satisfy strict type checking requirements

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