Skip to content

cli/named_args: Print correct cask ref when name is loaded as formula/keg#8483

Merged
MikeMcQuaid merged 1 commit intoHomebrew:masterfrom
whoiswillma:print-correct-cask-ref
Aug 27, 2020
Merged

cli/named_args: Print correct cask ref when name is loaded as formula/keg#8483
MikeMcQuaid merged 1 commit intoHomebrew:masterfrom
whoiswillma:print-correct-cask-ref

Conversation

@whoiswillma
Copy link
Copy Markdown
Contributor

@whoiswillma whoiswillma commented Aug 25, 2020

  • 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 tests with your changes locally?

Fix a bug where the wrong ref was printed for a cask from a third-party tap with the same name as a formula.

To recreate:

  1. Create a new tap, e.g. whoiswillma/cask
  2. Copy homebrew/cask/crunch.rb to whoiswillma/cask,
  3. Rename whoiswillma/cask/crunch to gifski or some other formula
  4. Run brew home gifski, which prints Treating gifski as a formula. For the cask, use homebrew/cask/gifski, when the correct ref should be whoiswillma/cask/gifski.

@whoiswillma whoiswillma changed the title named args: Print correct cask ref when name is resolved as formula/keg cli/named_args: Print correct cask ref when name is resolved as formula/keg Aug 25, 2020
@whoiswillma whoiswillma changed the title cli/named_args: Print correct cask ref when name is resolved as formula/keg cli/named_args: Print correct cask ref when name is loaded as formula/keg Aug 25, 2020
Copy link
Copy Markdown
Contributor

@maxim-belkin maxim-belkin left a comment

Choose a reason for hiding this comment

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

  1. Changes make sense to me.
  2. I'm not sure puts_treatment_... is the best name. Perhaps someone could suggest a better alternative.
  3. I'm not sure that Cask::CaskUnavailableError should be ignored.

Comment thread Library/Homebrew/cli/named_args.rb Outdated
@whoiswillma whoiswillma force-pushed the print-correct-cask-ref branch from 8636541 to d32be75 Compare August 25, 2020 15:57
Copy link
Copy Markdown
Contributor

@maxim-belkin maxim-belkin left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍

@whoiswillma
Copy link
Copy Markdown
Contributor Author

What's up with CI? The tests are passing on my local machine, and it seems the failure is unrelated to the changes I've made?

@maxim-belkin
Copy link
Copy Markdown
Contributor

What's up with CI? The tests are passing on my local machine, and it seems the failure is unrelated to the changes I've made?

Error message: https://github.com/Homebrew/brew/pull/8483/checks?check_run_id=1027387423#step:13:79

 RuntimeError:
   Git is unavailable

Perhaps related to 6776000

@MikeMcQuaid MikeMcQuaid merged commit 3866c0b into Homebrew:master Aug 27, 2020
@MikeMcQuaid
Copy link
Copy Markdown
Member

Nice work again @whoiswillma!

@whoiswillma whoiswillma deleted the print-correct-cask-ref branch August 28, 2020 13:43
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 14, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 14, 2020
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.

4 participants