bundle/remover: Remove description comments#21735
Merged
MikeMcQuaid merged 3 commits intomainfrom Mar 22, 2026
Merged
Conversation
4bdffd1 to
1974d89
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates brew bundle remove so that when an entry is removed from a Brewfile, any directly preceding description comment (typically produced by brew bundle dump --describe) is also cleaned up, addressing #21732.
Changes:
- Update the Bundle remover logic to drop a directly preceding comment line when removing a matching entry.
- Add an RSpec example asserting that a preceding description comment is removed along with the entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Library/Homebrew/bundle/remover.rb | Adjusts line-removal logic to also remove a preceding comment line when an entry is removed. |
| Library/Homebrew/test/bundle/commands/remove_spec.rb | Adds coverage to ensure a preceding description comment is removed with the entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
reviewed
Mar 15, 2026
Member
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Thanks, looking good so far!
- Fixes #21732. - When `brew bundle remove`ing, also clean up the directly preceding description comment (from `brew bundle dump --describe`, or any others).
1fbf887 to
1c541b0
Compare
MikeMcQuaid
reviewed
Mar 21, 2026
Member
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Looks good, almost there, thanks @issyl0!
- So that we don't remove things that users might have added themselves to segment their Brewfile into sections. - I needed to get the formula itself to check the description, and the cask, so I extracted a method `find_formula_or_cask` to avoid duplicating that logic in `possible_names` and `description_comment?`.
1c541b0 to
8c06615
Compare
6 tasks
MikeMcQuaid
approved these changes
Mar 22, 2026
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
f3c20a1 to
b074b4c
Compare
Member
|
Thanks @issyl0! |
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.
brew lgtm(style, typechecking and tests) with your changes locally?brew bundle removedoes not clean up descriptions in Brewfile #21732.brew bundle removeing, also clean up the directly preceding description comment (frombrew bundle dump --describe, or any others).