This is the first step towards using the download queue for all
download operations e.g. `brew install`, `brew upgrade`,
`brew reinstall` etc.
While we're here, do some API cleanup and Sorbet type improvements.
If we're running `brew style` on Homebrew/brew: let's ensure that we
don't run the `actionlint` checks as they are handled by the dedicated
`actionlint.yml` workflow.
- I found a few occurrences of this pattern from
https://github.com/orgs/Homebrew/projects/5?pane=issue&itemId=97021840,
that is an automated style request for:
`core: use / instead of + operator in e.g. (lib+"lv").install "lv.hlp"`.
- Upon adding tests I realised that there's also the `prefix + "bin"`
case that's already handled differently, so let's combine the handling
given it's the same `+` that's wrong.
Will fix or at least partly address:
```
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/os/linux/elf.rb:225: warning: The class Pathname reached 8 shape variations, instance variables accesses will be slower and memory usage increased.
35
It is recommended to define instance variables in a consistent order, for instance by eagerly defining them all in the #initialize method.
```
Add a new RuboCop to detect the use of 0.0.0.0 in formulae which
indicates binding to all network interfaces, internally or externally,
so is a bad default and potentially a security risk.
Co-authored-by: Issy Long <me@issylong.com>
Work on this has stalled a bit and it slows things down so let's require
an explicit opt-in to use it.
While we're here, remove the silent/implicit opt-out for CI, too.
This adds support for Cask old tokens used for renames of Casks.
We'll now correctly check these at installation time to avoid repeatedly
installing renamed Casks and dump them in the Brewfile. We also use this
logic to avoid cleaning up renamed Casks.
Formulae can execute arbitrary Ruby code when being loaded. In
particular, they can print to stdout with methods like `puts`. This can
break the parsing of output of commands like `brew info --json=v2`.
Let's fix that by capturing the output to stdout, and then printing
those messages to stderr instead (using `opoo` to try to discourage
formula authors from doing this).
- Homebrew Bundle referred to formulae as "brews". But it referred to
casks as "casks" and taps as "taps".
- Let's use the same terminology everywhere.
- (I know that `brew "hello"` is the formula syntax in the Brewfile, so
I'm not changing that (though would be up for it, in a backwards
compatible manner), just making the code more consistent.)