173 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
thibhero
76e7a13332 applying brew tests, typecheck, style 2025-05-07 12:29:32 -04:00
thibhero
f875dbc8a7 Implementing ask input with casks
renamed `ask` to `ask_formulae`
moving option `--ask` to work with formulae and casks
2025-05-07 12:07:29 -04:00
thibhero
5013c17474 formatting correctly with brew style 2025-05-03 15:39:43 -04:00
thibhero
1416da262b returning if formulae is empty 2025-05-03 15:23:20 -04:00
Mike McQuaid
d899f00c4b
Link to Support Tiers in diagnostic/error messages
Now that we have this nice URL let's reference it to allow our other
messages to be a bit shorter/kinder.
2025-04-01 11:35:27 +01:00
Mike McQuaid
e41a1f6d8a
Add brew install --as-dependency
This option avoids needing to immediately use
`brew tab --no-installed-on-request` when manually installing a
dependency.
2025-03-21 15:49:22 +00:00
Osama Albahrani
fde3538900
install.rb: add "no" in --ask output
- improves https://github.com/Homebrew/brew/pull/19254
2025-03-12 00:31:13 +03:00
thibhero
96983ee4ef Specifying the plural of formula 2025-03-07 16:21:05 -05:00
thibhero
c1d80ecf54 resolving conversations from pull request 2025-03-07 16:18:17 -05:00
thibhero
d7723fa6ed resolving conversations from pull request 2025-03-07 11:32:34 -05:00
thibhero
640556df39 correcting big space while displaying 2025-03-06 23:52:12 -05:00
thibhero
0b302dc3ad always include 2025-03-06 22:32:51 -05:00
thibhero
8506f1901a check only if formula is bottled for first formula 2025-03-06 22:20:52 -05:00
thibhero
483aa26aaa checking also the formula itself 2025-03-06 22:02:45 -05:00
thibhero
99fad7797c modifying files with brew style 2025-03-06 21:27:13 -05:00
thibhero
0b53e54bfa Moving ask input to Install.ask 2025-03-05 17:38:18 -05:00
thibhero
c5d80271f4 dont ask input if gets doesnt exist because of test 2025-03-02 20:03:39 -05:00
thibhero
7b3e469650 wrong array of formulae in compute sized 2025-02-25 14:28:44 -05:00
thibhero
1a43a9d258 extracting method to Homebrew/install.rb 2025-02-18 22:41:40 -05: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
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
Mike McQuaid
d1e539cb84
Merge pull request #18547 from Homebrew/cask-formula-dep-preinstall
Perform preinstall checks when a formula is installed via a cask
2024-10-13 17:40:59 +01:00
Bob Lail
a5db113d91 feat: Install an unlinked formula via brew install if --overwrite is passed
If the intention is to overwrite any existing links, then `brew install` should go on to install over an unlinked formula
2024-10-12 11:50:51 -07:00
Bo Anderson
97866f8adf
Perform preinstall checks when a formula is installed via a cask 2024-10-11 16:57:47 +01:00
Douglas Eichelberger
2d16333bbc Replace removable constants with overridable methods 2024-10-07 18:33:03 -07:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Mike McQuaid
af40f7d133
Revert "Create '.keepme' files in directories" 2024-05-10 08:26:31 +01:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02: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
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Bo Anderson
5692c8ecbf
Fix style violations under newer RuboCop 2023-12-14 05:47:12 +00:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00
Bo Anderson
a696bd8203
Support multiple oldnames for formulae 2023-04-27 05:15:43 +01:00
Douglas Eichelberger
95bea08a3b Fix visibility modifiers 2023-04-17 11:10:40 -07:00
Douglas Eichelberger
7fdd75ad41 brew style --fix 2023-04-17 11:00:55 -07:00
Douglas Eichelberger
09c679e75f Refactor module_function to reduce rbi need 2023-04-17 10:37:59 -07:00
Carlo Cabrera
6c3361e80f
install: check for --only-dependencies flag earlier
Currently, doing `brew install --only-dependencies` with an unlinked
formula does nothing and returns a message saying the formula is already
installed but just not linked.

I think that we should just install the dependencies as requested here
instead of complaining that the formula isn't linked.

Before:

    ❯ brew unlink adplug
    Unlinking /usr/local/Cellar/adplug/2.3.3... 8 symlinks removed.
    ❯ brew install --only-dependencies adplug
    Warning: adplug 2.3.3 is already installed, it's just not linked.
    To link this version, run:
      brew link adplug

After:

    ❯ brew install --only-dependencies adplug
    ==> Fetching dependencies for adplug: libbinio
    ==> Fetching libbinio
    ==> Downloading https://ghcr.io/v2/homebrew/core/libbinio/manifests/1.5
    [snip]

See Homebrew/homebrew-core#127133 for additional context.
2023-04-02 01:39:23 +08:00
Ruiyang Wu
007c896c97 Fix brew install --skip-post-install
Previous #15042 doesn't pass the flag all the way to
`FormulaInstaller.new`
2023-03-30 21:08:40 -04:00
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
e5fba88035
use includecount argument in pluralize 2023-03-19 23:35:47 -04:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
Bo Anderson
2055792791
Better support source builds under API mode 2023-02-06 13:27:36 +00:00
Mike McQuaid
97def3c104
install: better error when using API and --HEAD.
- Tell people what to do to resolve this
- Tweak the instruction ordering to be consistent elsewhere
2023-01-26 11:08:56 +00:00
Mike McQuaid
9c0708f2b5
Merge branch 'master' into add-dry-run-option-to-brew-install 2022-10-03 10:10:58 +01:00
Bo Anderson
9091ac0dad
Create GCC and glibc symlinks after install is complete
Fixes #13836.
2022-09-09 21:24:45 +01:00
hyuraku
5491f7b1bd share Install.print_dry_run_dependencies 2022-09-03 16:01:55 +09:00