5232 Commits

Author SHA1 Message Date
Douglas Eichelberger
a81239ec2d
Enable strict typing in Formula 2025-02-24 10:23:42 -08:00
Douglas Eichelberger
cf635bc28a
Merge pull request #19314 from Homebrew/typed-dep-helpers
Enable strict typing in DependenciesHelpers
2025-02-18 18:47:06 +00:00
Mike McQuaid
156ce5b9dc
Revert "cmd/info: only display keg info if tap matches" 2025-02-18 08:35:04 +00:00
Douglas Eichelberger
8763fb6d29 Resolve rubocop violations 2025-02-17 18:56:31 -08:00
Douglas Eichelberger
6b56c2ee5f Revert to_formulae_and_casks sig change 2025-02-16 15:41:57 -08:00
Douglas Eichelberger
ff7f70d8b6 Fix select_includes sig 2025-02-16 13:26:10 -08:00
Douglas Eichelberger
0037b1f626 Enable strict typing in DependenciesHelpers 2025-02-16 12:24:22 -08:00
Ruoyu Zhong
59445c7961
cmd/info: handle when tab tap is nil 2025-02-13 15:33:45 +08:00
Ruoyu Zhong
7aa1725aff
cmd/info: only display keg info if tap matches
Fixes #19294.
2025-02-13 01:39:21 +08:00
Mike McQuaid
8adc188992
Import brew alias and brew unalias commands
Import these from the homebrew/aliases tap and deprecate that tap.

This required a little messing around with class/module/constant names
to get `brew tests` and `brew typecheck` to play nicely.

I added also added Sorbet type signatures and integration tests.
2025-02-07 14:31:50 +00:00
Eric Knibbe
99de228fc2
docs: various manpage grammar fixes 2025-02-05 13:38:39 +01:00
Markus Reiter
c03a351ab9
Print concurrent download errors. 2025-02-03 14:44:01 +01:00
Markus Reiter
3e8709e4da
Use full terminal height for concurrent output. 2025-02-01 17:58:54 +01:00
Ryan Rotter
ba67ccfc6e
tap command: correct helptext for --repair 2025-02-01 00:45:16 -05:00
Mike McQuaid
7ff99e2353
Use ~ instead of ${HOME}
Partial revert of Homebrew/brew#19153
See https://github.com/Homebrew/brew/pull/19153#discussion_r1930678587
2025-01-27 15:19:59 +00:00
Mike McQuaid
bbf5a9f479
env_config: use environment variables consistently
- use e.g. `$HOMEBREW_*` for cases where only the environment variable
  is the entire backtick-quoted string
- use e.g. `${HOMEBREW_*}` for cases where the environment variable is
  part of a backtick-quoted string to make clear what parts are variable
  and what parts are not
- use `export HOMEBREW_*=...` for cases where we're talking about
  setting the environment variable (because it likely needs to be
  exported to work how they want)

Inspired by https://github.com/Homebrew/homebrew-bundle/pull/1579 making
similar changes for Homebrew/homebrew-bundle.
2025-01-27 14:21:27 +00:00
Mike McQuaid
b49625a7dc
Add brew install --skip-link
We already have `--skip-post-install` and this adds similar behaviour
for e.g. `brew bundle` (and other users) to be able to install a
formula but skip the `brew link` stage afterwards.
2025-01-23 14:42:03 +00:00
Issy Long
4c9de7d31c
Merge pull request #19084 from Homebrew/add-comments-to-rubocop-disables
Add clarifying comments to `rubocop:disable`s
2025-01-13 11:32:31 +00:00
Mike McQuaid
730c93e60f
Merge pull request #19087 from Homebrew/installed_on_request_true
Fix usage of `Tab#installed_(on_request|as_dependency)`
2025-01-13 09:36:05 +00:00
Mike McQuaid
0940fb78dc
Fix usage of Tab#installed_(on_request|as_dependency)
These can return `true`, `false` or `nil` so adjust the signature to
note this and fix the call sites to ensure we don't accidentally pass
through `nil` values when we shouldn't.

While we're here, make a `TODO` to fix this bad API up in future.

Fixes https://github.com/Homebrew/brew/issues/19076
2025-01-13 09:24:42 +00:00
Adrian Ho
85c9551cd3 update.sh: reject unknown long opts
I accidentally typed `brew update --greedy` instead of `brew upgrade --greedy` and got some strange output.

This fix causes unrecognized long options to throw a usage message and exit like all the other subcommands.

Before:
```
% brew update --greedy
==> Updating Homebrew...
Usage: brew update-report [--auto-update] [--force]

The Ruby implementation of brew update. Never called manually.
[...]
```

After:
```
% brew update --greedy
Error: Unrecognized option '--greedy'
Usage: brew update, up [options]

Fetch the newest version of Homebrew and all formulae from GitHub using git(1)
and perform any necessary migrations.
[...]
```
2025-01-13 09:41:09 +08:00
Douglas Eichelberger
0add431e69 Apply manual violation fixes 2025-01-12 10:06:00 -08:00
Douglas Eichelberger
dbb731bce2 brew style --fix 2025-01-12 10:05:21 -08:00
Issy Long
6ada9a9665
Add clarifying comments to rubocop:disables
- Needed for PR 18842 that adds a `DisableComment` RuboCop to ensure that all RuboCop disables have comments.
2025-01-12 16:59:07 +00:00
Mike McQuaid
c60efd943b
cmd/uses: improve flag description. 2024-12-30 12:43:20 +00:00
Thierry Moisan
2af190363f
fixup! deps command: add --include-implicit flag 2024-12-27 13:11:04 -05:00
Thierry Moisan
d5e94f2082
deps command: add --include-implicit flag 2024-12-24 15:28:47 -05:00
Andreas Scherer
02560c9f1a Sort list of '--version'ed casks.
'brew list --cask --version' produces an unsorted list.

Also, the cask part of 'brew list --version' is unsorted, while the
formulas are (still) sorted.
2024-12-24 14:02:16 +01:00
Mike McQuaid
402c47fcc4
Merge pull request #18978 from landoncrabtree/pyenv-major-symlink
cmd/pyenv-sync: Create major version symlink(s) to fix pyenv support
2024-12-23 17:00:53 +00:00
Landon Crabtree
b6e51ee3b8 Added proper pyenv support to brew pyenv-sync by symlinking major version executables to their minor 2024-12-22 10:33:26 -06:00
Ryan Rotter
5fdb1865f9 tap command: add -f alias to --force flag 2024-12-21 22:51:47 -05:00
“Vidisha
4403280211 cmd/list: fix duplicate casks when symlinks exist
When a cask is renamed (e.g. logi-options-plus to logi-options+),
Homebrew creates a symlink in the Caskroom directory. Currently,
`brew list --cask` shows both the original and symlinked cask as
separate entries. This patch modifies the listing logic to resolve
symlinks and show only unique casks.

Fixes #18849
2024-12-16 22:20:29 -08:00
apainintheneck
8bee0555b9 cask/info: send missing args after removing openstruct
This seems like it was a bug before the recent change to remove
OpenStruct from `Homebrew::CLI::Args` but it was failing silently
before. Now we pass the args to the `Cask::Info.info` method so
that when they eventually reach the `Utils::Analytics.output_analytics`
method they are present as expected.

Example error fragment:

```console
$ set -e HOMEBREW_NO_ANALYTICS
$ brew info iterm2 --cask --verbose
==> iterm2: 3.5.10 (auto_updates)
https://iterm2.com/
Installed
/usr/local/Caskroom/iterm2/3.5.4 (91.7MB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/i/iterm2.rb
==> Name
iTerm2
==> Description
Terminal emulator as alternative to Apple's Terminal app
==> Artifacts
iTerm.app (App)
Error: undefined method `analytics?' for an instance of Homebrew::CLI::Args
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:248:in `output_analytics'
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:342:in `cask_output'
/usr/local/Homebrew/Library/Homebrew/cask/info.rb:39:in `info'
```
2024-12-11 23:24:22 -08:00
Douglas Eichelberger
563c2b1d3a
Merge pull request #18847 from Homebrew/no-ostruct
Remove OpenStruct from CLI::Args
2024-12-11 18:41:13 +00:00
Ruoyu Zhong
a50e15e43c
cmd/list: support using --full-name with --installed-on-request et al.
Fixes https://github.com/Homebrew/brew/issues/18908#issuecomment-2532926860.
2024-12-11 11:27:08 +08:00
Douglas Eichelberger
3a4243742f Remove OpenStruct from CLI::Args 2024-12-08 10:27:49 -08:00
Douglas Eichelberger
ad70bcbbe0
Merge pull request #18867 from Homebrew/typed-named-args
Enable strict typing in NamedArgs
2024-12-04 08:49:46 -08:00
Douglas Eichelberger
e1fdd2eda4 Enable strict typing in NamedArgs 2024-12-03 17:43:22 -08:00
Carlo Cabrera
4029e3d7c1
cmd/update: avoid switching developers to stable branch
Checking for `HOMEBREW_NO_INSTALL_CLEANUP` was added in #18825, but this
breaks developers by switching them to the stable branch.

Setting `HOMEBREW_NO_UPDATE_CLEANUP` when `HOMEBREW_NO_INSTALL_CLEANUP`
is set seems like a relatively recent addition, so I don't think it
hurts to just remove it. We can add it back (correctly) if there are
users that need it.
2024-12-04 01:32:52 +08:00
Mike McQuaid
58e72b0a7f
Merge pull request #18856 from Homebrew/fix_brew_developer 2024-12-03 15:41:13 +00:00
Mike McQuaid
fc40424f0e
cmd/update-reset: remove .git/describe-cache.
As this is a cache and can potentially be incorrect, let's allow this
way of cleaning it up.
2024-12-03 14:30:14 +00:00
Mike McQuaid
5f82dd1880
cmd/developer: fix HOMEBREW_UPDATE_TO_TAG handling.
The handling of `HOMEBREW_UPDATE_TO_TAG` was incorrect as it implied it
also enabled developer mode whereas the opposite was true.
2024-12-03 09:08:50 +00:00
Eric Knibbe
1ed026c91a
update.sh: fix unused environment variable 2024-11-25 22:43:48 -05:00
Mike McQuaid
56780f3355
Merge pull request #18806 from Homebrew/rm-uses-ostruct
Remove OpenStruct from Uses cmd
2024-11-25 08:51:07 +00:00
Eric Knibbe
51be1d9652
revert setting --insecure to download ca-certificates 2024-11-24 14:57:32 -05:00
Douglas Eichelberger
cb1c49e06b Fix sigs 2024-11-23 10:25:45 -08:00
Douglas Eichelberger
89e640c567 Remove OpenStruct from Uses cmd 2024-11-22 21:04:51 -08:00
Mike McQuaid
4d4531c19d
Revamp installed_on_request handling
- `reinstall` and `upgrade` no longer mark as installed on request,
  with or without names specified, but preserve the version from the
  tab instead
- default `install_on_request` to `false` rather than `true`
- only set installed in request in a tab if it's missing rather than
  false

Co-authored-by: Michael Cho <michael@michaelcho.dev>
2024-11-19 08:39:55 +00:00
Douglas Eichelberger
ebe1e504da Change command output instead 2024-11-07 11:26:19 -08:00
Douglas Eichelberger
c17ffb8c3b Try matching key type 2024-11-07 09:24:50 -08:00