Filter info JSON package types#22851
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates brew info’s --json=v2 output to properly honor --formula/--cask filtering, preventing cask enumeration (and related side effects) when formula-only JSON is requested.
Changes:
- Respect
--formula/--caskfilters for--json=v2in both--installedandeval_allJSON inventory paths. - Avoid calling cask inventory/eval-all enumerators when
--formulais set for v2 JSON. - Add tests covering formula-only JSON for installed and eval-all paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Library/Homebrew/cmd/info.rb |
Skips formula/cask enumeration in v2 JSON based on --formula/--cask flags, fixing incorrect cask inclusion. |
Library/Homebrew/test/cmd/info_spec.rb |
Adds regression tests ensuring casks are excluded (and not enumerated) for formula-only v2 JSON output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bo98
approved these changes
Jun 22, 2026
- Respect package-type filters for `brew info --json=v2` output. - Avoid loading casks for formula-only JSON inventory paths. - Cover installed and eval-all formula-only JSON regressions.
06aea11 to
cbd398f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22850
brew info --json=v2output.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local review, testing and tweaking.