Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Dec 23, 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?

Following up on lack of tests mentioned by Copilot in:

This found an incorrect type for option_defined? as we pass in Option at:

next if dep_f.option_defined?(opt)

Copilot AI review requested due to automatic review settings December 23, 2025 17:48
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 adds comprehensive test coverage for dependency tag validation in the formula auditor and fixes an incorrect type signature for the option_defined? method that was discovered while writing the tests.

  • Adds tests for all dependency tag scenarios (valid tags, no-op tags, invalid tags, and option-based tags)
  • Fixes type signature for option_defined? to accept both Option and String types

Reviewed changes

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

File Description
Library/Homebrew/test/formula_auditor_spec.rb Adds comprehensive test suite for dependency tag validation, covering valid tags (:build, :optional), no-op tags (:run, :linked), invalid tags, and option-based dependencies
Library/Homebrew/software_spec.rb Corrects type signature of option_defined? from String to T.any(Option, String) to match actual usage where Option objects are passed

💡 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, good catch!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 24, 2025
@cho-m cho-m added this pull request to the merge queue Dec 24, 2025
Merged via the queue into main with commit c8690b2 Dec 24, 2025
43 checks passed
@cho-m cho-m deleted the formula_auditor-check-tag-tests branch December 24, 2025 21:11
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