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

Allow references to casks when running uninstall and reinstall #7853

Merged
merged 23 commits into from Jul 6, 2020
Merged

Allow references to casks when running uninstall and reinstall #7853

merged 23 commits into from Jul 6, 2020

Conversation

whoiswillma
Copy link
Member

  • 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?

Allow referencing a cask when running brew uninstall and brew reinstall. If a name cannot be resolved to a formula, then an attempt at resolving a cask is made.

I had difficulty writing tests for brew reinstall <cask> due to an issue with casks in the regular brew test environment. More about that on the Homebrew discourse: https://discourse.brew.sh/t/brew-test-environment-running-cask-commands-from-within-brew-tests/8179

@whoiswillma whoiswillma changed the title Integrate uninstall reinstall Allow references to casks when running uninstall and reinstall Jun 29, 2020
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.

Looking great so far, fantastic work @whoiswillma!

Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/reinstall.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/reinstall.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/uninstall.rb Outdated Show resolved Hide resolved
@whoiswillma
Copy link
Member Author

Do you have any suggestions on how to test brew reinstall?

Library/Homebrew/cmd/reinstall.rb Show resolved Hide resolved
Library/Homebrew/cmd/uninstall.rb Outdated Show resolved Hide resolved
Library/Homebrew/test/cmd/uninstall_spec.rb Outdated Show resolved Hide resolved
@MikeMcQuaid
Copy link
Member

Do you have any suggestions on how to test brew reinstall?

This may scare you a bit but: not really, no. It's pretty hard to test logic for cmd/ files without being really, really slow. If it's possible to extract some logic to another class (e.g. reinstall.rb) we could write unit tests for that. I think it would be 🆗 for this PR to not have tests, given this.

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.

Looking good so far, nice work!

Library/Homebrew/.idea/.gitignore Outdated Show resolved Hide resolved
Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cli/args.rb Show resolved Hide resolved
Library/Homebrew/cli/args.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/reinstall.rb Outdated Show resolved Hide resolved
Library/Homebrew/cmd/uninstall.rb Outdated Show resolved Hide resolved
@MikeMcQuaid MikeMcQuaid merged commit 1558179 into Homebrew:master Jul 6, 2020
@MikeMcQuaid
Copy link
Member

Great work again @whoiswillma!

@whoiswillma whoiswillma deleted the integrate-uninstall-reinstall branch July 6, 2020 22:41
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 25, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 25, 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.

None yet

3 participants