Skip to content

fix: rescue FormulaSpecificationError in Formula.all#21796

Merged
MikeMcQuaid merged 2 commits intoHomebrew:mainfrom
costajohnt:fix/formula-all-rescue-specification-error
Mar 22, 2026
Merged

fix: rescue FormulaSpecificationError in Formula.all#21796
MikeMcQuaid merged 2 commits intoHomebrew:mainfrom
costajohnt:fix/formula-all-rescue-specification-error

Conversation

@costajohnt
Copy link
Copy Markdown
Contributor

@costajohnt costajohnt commented Mar 21, 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 for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Claude Code was used to help investigate the stack trace and implement the fix. All changes were reviewed and verified manually, and the test suite was run locally (brew tests --only formula — all passing).

What does this PR do?

When a tap formula has no URL, determine_active_spec raises FormulaSpecificationError. Formula.all already rescues FormulaUnavailableError and FormulaUnreadableError to prevent one broken formula from crashing commands like brew search --eval-all --desc, but FormulaSpecificationError was missing from the rescue clause.

This adds FormulaSpecificationError to the rescue so the broken formula is logged as a warning instead of crashing the entire search.

Why should this be included?

A single broken tap formula (with no URL) shouldn't take down brew search --eval-all --desc for the user's entire formula catalog.

Closes #21794

When a tap formula has no URL, `determine_active_spec` raises
`FormulaSpecificationError`. `Formula.all` already rescues
`FormulaUnavailableError` and `FormulaUnreadableError` to prevent
a single broken formula from crashing commands like `brew search
--eval-all --desc`, but `FormulaSpecificationError` was missing
from the rescue clause.

Closes Homebrew#21794
@costajohnt costajohnt marked this pull request as ready for review March 21, 2026 23:26
@costajohnt
Copy link
Copy Markdown
Contributor Author

Before/After
Screenshot 2026-03-21 at 4 27 10 PM

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 @costajohnt!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 22, 2026
Merged via the queue into Homebrew:main with commit 6c6f30c Mar 22, 2026
36 checks passed
@costajohnt costajohnt deleted the fix/formula-all-rescue-specification-error branch March 22, 2026 14:21
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.

Adding tap with invalid url definition breaks search in descriptions

2 participants