Skip to content

bundle/checker: enable typed: strict#22157

Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
bittoby:sorbet/strict-bundle-checker
May 7, 2026
Merged

bundle/checker: enable typed: strict#22157
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
bittoby:sorbet/strict-bundle-checker

Conversation

@bittoby
Copy link
Copy Markdown
Contributor

@bittoby bittoby commented May 6, 2026

  • 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 (excluding integration tests) for your changes?
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Bumps Library/Homebrew/bundle/checker.rb from # typed: true to # typed: strict. This finishes the directory-wide migration started in #21935, which left checker.rb and commands/exec.rb as the only two typed: true files remaining under Library/Homebrew/bundle/.

To satisfy strict mode the change also:

  • adds sig blocks to the eight previously unsigned def self.* methods (check, apps_to_install, formulae_to_start, taps_to_tap, casks_to_install, formulae_to_install, registered_extensions_to_install, reset!);
  • declares the module-level @dsl instance variable as T.nilable(Homebrew::Bundle::Dsl) in reset!; and
  • adds raise ArgumentError, "dsl is unset!" unless @dsl before the three @dsl.entries accesses, mirroring the pattern already used in Library/Homebrew/bundle/commands/cleanup.rb.

No new tests: there is no behaviour change on the happy path. The new guard converts one specific misuse (calling a private check method without first invoking .check) from an opaque NoMethodError on nil into an explicit ArgumentError, matching the message used by cleanup.rb. The existing test/bundle/commands/check_spec.rb covers the public surface and continues to pass.

Verified locally:

  • ./bin/brew typecheck : No errors
  • ./bin/brew style --fix --changed : no offenses
  • ./bin/brew tests --only=bundle/commands/check : 20 examples, 0 failures

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

@bittoby
Copy link
Copy Markdown
Contributor Author

bittoby commented May 6, 2026

Hi @MikeMcQuaid I opened first PR for this repository. Could you please review this? Welcome to any feedback. Thanks

@rexmhall09
Copy link
Copy Markdown
Contributor

rexmhall09 commented May 7, 2026

In case you were wondering, I think the docs job is failing because HTML-Proofer is getting 503s from existing Debian wiki links (wiki.debian.org/DFSGLicenses). I saw the same error on my PR, so it’s most likely an issue with the Debian wiki being temporarily unavailable.

Copy link
Copy Markdown
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, nice work!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue May 7, 2026
Merged via the queue into Homebrew:main with commit 9db47e0 May 7, 2026
38 of 39 checks passed
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.

3 participants