6120 Commits

Author SHA1 Message Date
Mike McQuaid
eec800149f
Merge pull request #20238 from Homebrew/fix_rubocop_fixture_style
`fixtures/rubocop@x.x.x.rbi`: fix style.
2025-07-11 13:17:54 +00:00
Issy Long
7f333ab6ec
Merge pull request #20235 from Homebrew/slash-not-plus-in-paths
rubocops/text: Prefer `lib/"string"` over `lib+"string"`
2025-07-11 12:56:54 +00:00
Mike McQuaid
607ffafd9f
fixtures/rubocop@x.x.x.rbi: fix style.
At least for me locally: `brew style` complains about this and
`brew style --fix` autocorrects it.
2025-07-11 13:54:51 +01:00
Issy Long
d4d1b4a22a
rubocops/text: Prefer lib/"string" over lib+"string"
- 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.
2025-07-11 13:41:58 +01:00
Mike McQuaid
71bab462e1
Add ZeroZeroZeroZero cop
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>
2025-07-11 08:24:19 +01:00
Mike McQuaid
a2bf23ef70
Merge pull request #20224 from Homebrew/cask_dumper_old_tokens
Support Cask renames when installing/dumping
2025-07-10 13:54:26 +00:00
Mike McQuaid
e8bfa23877
Support Cask renames when installing/dumping
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.
2025-07-10 08:05:36 +00:00
Issy Long
50c3181cdb
Rename the brew_{dumper,installer}_spec.rb files
- The classes were renamed in 990c1efc16aad71254ae89e0b7983eee97696c72,
  but I forgot to rename the test filenames.
2025-07-09 17:47:08 +01:00
Mike McQuaid
5ec756e0ca
Merge pull request #20193 from Homebrew/skinny-rubocop-rbi
Keep only the parts of `rubocop.rbi` that we actually use
2025-07-07 16:59:45 +00:00
Douglas Eichelberger
43b72d3633
Merge pull request #20213 from Homebrew/dug-20205
Exit non-zero when pinning uninstalled formula
2025-07-04 21:56:14 +00:00
Douglas Eichelberger
f4bcda325a
Exit non-zero when pinning uninstalled formula 2025-07-04 13:28:54 -07:00
Issy Long
990c1efc16
bundle: Rename "brews" to "formulae" for consistency
- 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.)
2025-07-04 21:08:37 +01:00
Issy Long
836d85277f
Keep only the parts of rubocop.rbi that we actually use
- This file was _massive_ - over 60k lines and we had to bump the file
  size limit for pushes to the repo!
- This was because by default Tapioca, when it encounters a
  `require "rubocop"` during RBI generation, loads all of the cops ever
  because they're all classes inside `RuboCop::Cop`.
- There wasn't an easy way to control this at Tapioca generation time
  (we tried), so now we parse the generated RBI file and delete classes
  and method definitions that we don't use.
- I regenerated the RBIs (`brew tc --update rubocop`) and added new
  things to the allowlist until Sorbet came back green.
- Now the file is ~7k lines and 240K - much better!
2025-07-04 00:27:12 +01:00
Eric Knibbe
f5c5d26173
cmd/dev-cmd: fetch HOMEBREW_EVAL_ALL for --eval-all 2025-07-03 12:59:12 -04:00
Eric Knibbe
f92e961ff1
github_runner_matrix: fix skipped runner creation 2025-07-01 15:07:24 -04:00
Anatoli Babenia
3e36e98db3 create: detect URL from latest release if it isn't archive
Detects source archive for GitHub URL without version. Both releases
and tags share the same URL pattern for source archive

  https://github.com/Homebrew/brew/releases
  https://github.com/Homebrew/brew/tags
2025-06-26 15:07:51 +03:00
Mike McQuaid
b87d2887fe
Merge pull request #20033 from tyuwags/master
Refine ask‐option dependency resolution and strengthen tests
2025-06-26 10:52:46 +00:00
Patrick Linnane
f4491e0c8f
Merge pull request #20167 from Homebrew/update_report_display_descriptions
cmd/update-report: display descriptions for new formulae and casks.
2025-06-24 20:26:47 +00:00
Mike McQuaid
28753ef002
cmd/update-report: display descriptions for new formulae and casks.
This parses Homebrew's API JSON data to display descriptions for new
formulae and casks if available.

While we're here also add tests for ReporterHub.
2025-06-24 16:59:24 +01:00
Mike McQuaid
d661cffc1f
Switch to using main as the default branch
Homebrew/brew has moved to a `main` default branch so we can more move
references from `master` to `main`.
2025-06-24 11:14:57 +01:00
Mike McQuaid
2c16fe9184
Merge pull request #20160 from Homebrew/mcp_server_eof
mcp_server: fix EOF handling.
2025-06-23 16:04:29 +00:00
Mike McQuaid
818662352c
mcp_server: fix EOF handling.
We need to handle when `stdin` is closed but there's no interrupt
signal.

Without this, the server will be stuck an in infinite busy loop.
2025-06-23 16:50:39 +01:00
Mike McQuaid
55f65ec375
audit: ensure that official formula and cask names don't conflict.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2025-06-23 16:08:13 +01:00
Mike McQuaid
9d357b57d1
Merge pull request #20135 from Homebrew/forbid_dynamic_caveats
rubocops/caveats: check for dynamic caveats.
2025-06-20 07:57:06 +00:00
Anatoli Babenia
dce285458e Add test for name override with GitHub URLs 2025-06-19 16:28:48 +03:00
Mike McQuaid
f77c9861de
rubocops/caveats: check for dynamic caveats.
This will avoid issues with the JSON API.
2025-06-19 10:13:32 +01:00
Mike McQuaid
2cd7a32660
formula_creator: improve code/test style. 2025-06-19 09:02:46 +01:00
Anatoli Babenia
3964186bec
formula_creator: fetch missing version from latest GitHub release 2025-06-19 09:02:36 +01:00
Mike McQuaid
ccb3543c6c
Merge pull request #20126 from botantony/no_autobump_rubocops
rubocops: add `no_autobump!` rubocop
2025-06-18 14:33:37 +00:00
botantony
aecdcd4840
rubocops: add no_autobump! rubocop
Signed-off-by: botantony <antonsm21@gmail.com>
2025-06-18 16:16:12 +02:00
Anatoli Babenia
f738fce3d9
formula_creator: test GitHub repo call for archive|releases URLs 2025-06-18 15:07:44 +01:00
Patrick Linnane
989032b703
test/cask/reinstall_spec: remove confusing zap` messaging
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2025-06-17 21:15:49 -07:00
Thibaut Hérault
27a040cc32
Merge branch 'master' into master 2025-06-17 20:49:18 -04:00
thibhero
1b0e79121a brew style error 2025-06-17 20:36:47 -04:00
thibhero
ea7d441370 removing fixture 2025-06-17 20:21:41 -04:00
thibhero
fc18956eeb removing longer tests and putting back integration_test.rb 2025-06-17 20:21:32 -04:00
Mike McQuaid
c5d091af21
Refactor/typecheck create and formula_creator 2025-06-17 11:44:15 +01:00
Anatoli Babenia
85d48da364
Refactor FormulaCreator args and call parse_url automatically
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-06-17 11:19:52 +01:00
Mike McQuaid
ad28cc7cf5
Merge pull request #20108 from Homebrew/macos_version-upgrade-type-sigil
MacOSVersion: enable strong typing, expand tests
2025-06-16 07:37:02 +00:00
Mike McQuaid
62ca1323df
Merge pull request #20112 from Homebrew/add-newest-supported-env-var
Add HOMEBREW_MACOS_NEWEST_SUPPORTED env var
2025-06-16 07:28:44 +00:00
Sam Ford
ea57773327
MacOSVersion: expand test coverage
This adds tests to expand coverage of `MacOSVersion` to 100% for lines
and branches.
2025-06-15 09:02:42 -04:00
Anatoli Babenia
d2b6531f01 Replace hardlinks with symlinks for brew tests
Fixes https://github.com/Homebrew/brew/issues/20114
2025-06-15 14:08:04 +03:00
Sam Ford
764d2b2dcc
Add HOMEBREW_MACOS_NEWEST_SUPPORTED env var
We have a `HOMEBREW_MACOS_NEWEST_UNSUPPORTED` environment variable
and this is used in `MacOSVersion` to determine prerelease versions
but we don't have a way of easily determining the newest supported
macOS version.

`bump-cask-pr` contains logic that assumes the first key/value in
`MacOSVersion::SYMBOLS` is the newest macOS version but it recently
became clear that this is a prerelease version between WWDC and the
subsequent macOS release. Similarly, `dev-cmd/generate-cask-api.rb`
tries to compute the newest stable macOS version as
`HOMEBREW_MACOS_NEWEST_UNSUPPORTED.to_i - 1` and this will fail
if/when we update that variable to `"26"`, as the macOS version
before 26 is 15, not 25.

This adds a `HOMEBREW_MACOS_NEWEST_SUPPORTED` environment variable,
so we have a straightforward way of quickly identifying the newest
supported macOS version without having to make potentially unreliable
assumptions or do computations to identify the latest non-prerelease
`MacOSVersion` value. This also updates the two aforementioned areas
to use this environment variable to produce the newest stable macOS
version symbol in a more reliable way.
2025-06-14 18:45:25 -04:00
Rylan Polster
54b349bb89
Revert "Only generate cask variations for supported macOS configurations" 2025-06-12 11:53:01 -04:00
Eric Knibbe
8063291f7c
Merge pull request #20090 from Lekensteyn/remove-force-auto-update-option
Remove unused --force-auto-update option
2025-06-12 13:51:36 +00:00
Peter Wu
770335f72e Remove unused --force-auto-update option
Remove the `brew tap --force-auto-update` option and the
`force_auto_update` configuration file option from Homebrew Bundles.

Fixes #19856
2025-06-12 14:16:12 +02:00
thibhero
fb5ddde5ad resolving discussions 2025-06-11 22:36:57 -04:00
Rylan Polster
e5667cb5ae
Only generate cask variations for supported macOS configurations 2025-06-11 20:30:14 -04:00
Rylan Polster
b242abfdf0
Fix cask API tests 2025-06-11 19:44:26 -04:00
Mike McQuaid
dffa42839c
Merge branch 'master' into master 2025-06-11 13:24:46 +01:00