79 Commits

Author SHA1 Message Date
Mike McQuaid
9ac306e464
Remove alias generic_* definitions in favour of using super
This is the pattern we've been adopting for a while and it's a bit
cleaner. Let's remove all of the existing usage of the existing pattern
to avoid confusion when adopting the new one.
2025-06-16 08:10:08 +00:00
Issy Long
becc4991d0
missing_formula: Bump to Sorbet typed: strict 2024-08-10 00:21:12 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Caleb Xu
fcb3f8c553
missing_formula: remove sshpass from denylist 2023-09-07 21:51:12 -04:00
Alexander Bayandin
a115fcd0dc
missing_formula: update instructions for pil and gsutil 2023-03-29 18:23:04 +01:00
apainintheneck
2601cc410b Only optimize for the core tap 2022-11-17 21:15:43 -08:00
apainintheneck
c787df5294 Optimize deleted_reason for all taps 2022-11-15 00:09:52 -08:00
apainintheneck
2bc54e56e4 Optimize CoreTap in .deleted_reason
This limits the previous change to only the
core tap in `MissingFormula.deleted_reason`.

The reason for this is that the `git log` command
only becomes a performance issue when the number
of monthly commits is high which really only happens
with the core tap.
2022-11-12 00:01:06 -08:00
apainintheneck
5241439f43 Speed up MissingFormula.deleted_reason
The current way we find out where a formula was deleted is
using `git log` to query the last months worth of formula.
For core formula that is 11,000+ commits which makes this slow.

This quits early by diffing the current branch with a commit
from a month ago and checks if that file has been deleted in the
meantime. Then, it procedes with the above `git log` command.

Note: This will miss formula that were introduced less than a month
ago and removed in the meantime though that is seemingly very rare.
2022-11-11 14:39:50 -08:00
Mike McQuaid
64d368aeb9
missing_formula: message for postgres rename.
PostgreSQL is being renamed to always be a versioned formula so handle
when people type `brew install postgresql`.
2022-08-10 15:15:21 +01:00
Bo Anderson
861dea9ada
Bump various type strictnesses 2021-09-11 01:00:23 +01:00
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
Andreas Tolfsen
317c14daa6 missing_formula: fix cask installation advice on tap migration
When an installed formula is missing and its source has migrated
to a new tap, Homebrew warns the user about this, saying:

	You can access it again by running:
	  brew tap new-name
	And then you can install it by running:
	  brew cask install new-name

Unfortunately, the "brew cask install" incantation is deprecated
and the advice won't work:

	Error: Calling brew cask install is disabled! Use brew install [--cask] instead.

This alters the advice to use the new "brew install --cask" notation,
fixing the advice presented to the user.
2021-01-04 13:09:45 +01:00
Markus Reiter
6750448d95 Fix some auto-correctable type errors. 2020-11-29 21:23:54 +01:00
Markus Reiter
3c2ec1c60f Deprecate remaining cask commands. 2020-11-21 19:56:12 +01:00
Roger Leigh
a96e15ec16 Permit installation of googletest 2020-10-19 12:48:43 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
4d636d1335 Document MissingFormula. 2020-08-26 03:13:59 +02:00
Rui Chen
5cbdae75e7 Remove cargo-completion formula
relates to Homebrew/homebrew-core#57029, Homebrew/homebrew-core#57494
2020-07-05 12:47:15 -04:00
Issy Long
8eba9b86ab
Change occurrences of "blacklist" to "denylist" or "disallow"
- Depending on context, I've gone for either "denylist" or "disallow"
  here. "Disallow" for things in sentences, or actions, and "denylist"
  for list of things.
2020-06-06 22:38:33 +01:00
Issy Long
2a36f61c19
missing_formula: TexLive is only blacklisted on macOS
- In Homebrew/linuxbrew-core, [we have a Linux-only formula for
  `texlive`](https://github.com/Homebrew/linuxbrew-core/tree/master/Formula/texlive.rb).
- When running `brew audit --strict texlive` on Linux, we got the
  following messaging:

  ```
  $ brew audit --strict texlive
  texlive:
    * 'texlive' is blacklisted from homebrew/core.
    Error: 1 problem in 1 formula detected
  ```

- Looking at where this comes from leads to the missing formula
  messaging to install `mactex` via Homebrew Cask. The 'blacklisted in
  homebrew/core' messaging only applies to macOS where Casks are an option
  for users, so let's not surface the audit for `texlive` on Linux.
2020-02-15 19:51:48 +00:00
Ryan S. Elliott
733b03ecd0 whitelist asymptote 2020-01-28 10:12:24 -06:00
Zach Auten
ecc7b9e174 cask_reason will suggest brew cask uninstall 2019-07-31 00:31:12 -04:00
Isabell (Issy) Long
4a5b02661a
[Linux] Don't prompt users to brew cask install
- I tried to install `keybase`, thinking I'd get the CLI. On Linux,
  casks don't work, yet I was still prompted to `brew cask install
  keybase`. When I tried that (just to make sure), I got the "casks are
  only supported on MacOS" error.
- This change makes it so we don't prompt people to install casks if
  they're on platforms other than MacOS.

Before:

```
╭─issyl0@grus /home/linuxbrew/.linuxbrew/Homebrew ‹master›
╰─ $ brew install keybase
Error: No available formula with the name "keybase"
Found a cask named "keybase" instead.
```

After:

```
Error: No available formula with the name "keybase"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
```
2019-05-25 15:44:46 +01:00
Mike McQuaid
fc6bd2ea1c
Fixup more frozen string handling. 2019-04-20 14:07:29 +09:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
15c38a2d8b formatting fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
cf4511f72a
Merge pull request #5538 from zachauten/brew-info-display-casks
Make brew info output cask if no formula exists
2019-03-25 16:54:03 +00:00
Zach Auten
999c4743d0 Added flag for cask_reason to output cask info or just message with cask name 2019-03-24 15:28:34 -04:00
Zach Auten
517083474a Removed cask_reason from missing_formula.reason
- It won't output anything during a failed 'brew install'
- There's a seperate call to MissingFormula.cask_reason
  when 'brew info' is executed on a cask.
2019-03-21 17:35:38 -04:00
Zach Auten
e9b17b8593 Replaced 'unless nil' with 'if' 2019-03-16 12:59:15 -04:00
Mike McQuaid
e1e69da6b3
missing_formula: add brew cask command. 2019-03-11 12:33:51 +00:00
John Marshall
c508bda668 Further clarify that it is recommended to just install MacTeX
Less wordy.
2019-03-11 07:43:12 +00:00
Zach Auten
18a20986e7 Addressed style issues 2019-03-06 18:06:50 -05:00
Zach Auten
fe643758d7 Updated get_info
- get_info builds info string by appending helper functions
  - removed unnecessary returns
  - fixed indentation in missing_formula
  - reduced size of regex in info_spec
  - missing_formula will indicate when it finds a cask with same name
2019-03-06 00:27:48 -05:00
John Marshall
0c6164a1c1 Ensure "brew install mactex" also brings up this help text 2019-02-28 12:39:32 +00:00
John Marshall
a7022736ad Clarify that TeX Live Utility (tlmgr) comes with the TeX installation
MacTeX is the macOS package of TeX Live; also mention the latter for
the sake of non-Mac Brew.
2019-02-28 10:33:45 +00:00
John Marshall
0c7c45a131 missing_formula: add message for Asymptote
Per Homebrew/legacy-homebrew#23029, there is no formula for Asymptote
because you may well already have it installed via MacTeX anyway.
2019-02-27 08:38:29 +00:00
Zach Auten
ed80b60834 Fixed installation info output and imports 2019-02-21 21:08:57 -05:00
Waldir Pimenta
d4e3fb45cb
missing_formula.rb: add help message for uconv 2019-02-19 10:51:52 +00:00
Andrew Dunning
332f437f39
MacRuby > RubyMotion 2019-02-18 16:20:59 -05:00
Andrew Dunning
1efdd41887
Further improvement to blacklist messages 2019-02-18 15:42:49 -05:00
Zach Auten
554106d2e0 Updated missing formula cask reason
- search_for_cask in missing_formula renamed to is_a_cask_reason
    - is_a_cask calls new getInfo method in cask/cmd/info.rb to return info
      string
    - self.info in info.rb now calls getInfo and puts return value
    - added ohai_title to return the ohai printout for only titles, so that
      ohai printout could be added to the getInfo return string without
      calling puts.
    - refactored ohai to use ohai_title
    - updated info_spec.rb cask info test to be more specific when
      matching stderr.
    - is_a_cask_reason will respect 'silent'
    - refactored print_caveats to return instead of print
2019-02-18 03:33:57 -05:00
Zach Auten
648c8e4672 Merge branch 'master' into brew-info-display-casks 2019-02-18 03:26:43 -05:00
Andrew Dunning
60b698ba28
Clean up blacklisted package messages
Ensure consistent formatting and provide references to all MacTeX packages
2019-02-16 17:31:24 -05:00
Waldir Pimenta
2dccfe1d02
Update missing_formula.rb 2019-02-05 14:05:57 +00:00
Waldir Pimenta
3dc0df5a77
missing_formula.rb: add help message for cargo
...modeled after the existing message for pip.

Also sync format of the gfortran and lzma messages,
and use typographic apostrophe in the *tex message.
2019-02-05 13:38:08 +00:00
Zach Auten
abb81a52e6 Updated PR in response to suggestions
- changed require_relative to require
    - removed useless begin
    - removed unnecessary test
    - updated brew info positive test case to verify a cask was found
    - moved cask search logic to missing_formula.rb
2019-01-26 22:03:41 -05:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00