Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew list shows cask without option #12003

Merged
merged 4 commits into from Sep 11, 2021

Conversation

hyuraku
Copy link
Contributor

@hyuraku hyuraku commented Sep 8, 2021

  • 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 style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

solve #11983

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.

Looks good so far, nice work!

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! A few suggestions

Library/Homebrew/cmd/list.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/list.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/list.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/list.rb Outdated Show resolved Hide resolved
@Rylan12 Rylan12 linked an issue Sep 8, 2021 that may be closed by this pull request
@cnnrmnn
Copy link
Contributor

cnnrmnn commented Sep 9, 2021

@hyuraku If I'm correct and brew list <formula-name> currently errors out, it might be worth adding a spec here to catch this.

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my comments above and then it looks good to me!

I also wouldn't mind verification (maybe from @cnnrmnn) that the change to to_formulae_to_casks is okay but I'm pretty sure it's fine so probably not necessary to merge.

Copy link
Contributor

@cnnrmnn cnnrmnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to to_formulae_to_casks looks fine to me! Might be worth thinking about reorganizing that family of methods in the future. Is a bit strange that methods meant to return formulae and casks will return kegs if given some methods and formulae if given others.

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one more naming thing I just noticed. The variables don't really contain the names but rather contain the actual kegs and casks themselves. After this, ✅ from me

@@ -132,7 +132,10 @@ def list
system_command! "find", args: args.named.to_default_kegs.map(&:to_s) + %w[-not -type d -print],
print_stdout: true
else
args.named.to_default_kegs.each { |keg| PrettyListing.new keg }
formula_names, cask_names = args.named.to_formulae_to_casks(method: :default_kegs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
formula_names, cask_names = args.named.to_formulae_to_casks(method: :default_kegs)
kegs, casks = args.named.to_formulae_to_casks(method: :default_kegs)

args.named.to_default_kegs.each { |keg| PrettyListing.new keg }
formula_names, cask_names = args.named.to_formulae_to_casks(method: :default_kegs)

formula_names.each { |keg| PrettyListing.new keg } if formula_names.present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
formula_names.each { |keg| PrettyListing.new keg } if formula_names.present?
kegs.each { |keg| PrettyListing.new keg } if kegs.present?

Library/Homebrew/cmd/list.rb Outdated Show resolved Hide resolved
Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @hyuraku! Nice work!

@Rylan12 Rylan12 merged commit 8db3289 into Homebrew:master Sep 11, 2021
@hyuraku hyuraku deleted the brew-list-shows-cask-without-option branch September 12, 2021 05:01
@github-actions github-actions bot added the outdated PR was locked due to age label Oct 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew ls should show info for installed casks if no keg is found
4 participants